sunlight

Countdown

Introduction

Countdown is a solver for 'Countdown'-style problems, where a target number is given along with a set of 6 numbers, the object being to achieve the target number using the given numbers once only, and any of the operators +, -, *, /. It illustrates the principles of RPN stack evaluation.

Countdown Code Notes

You can view the source code here: Countdown.cpp. You can also download a Zip file of the source code, including a Microsoft Visual C++ project you can use to build the project.

Things to note:

  • The program builds an RPN stack the 'wrong' way - rather than building it up from an expression, it builds all the possible expressions. It then evaluates the stack. 

Countdown Download

Source code (4k): CountdownSrc.zip

Executable (44k): Countdown.exe

 

Copyright © David McCabe, 1998 - 2001. All rights reserved.

You will need to download and install the m-math control to display any equations on this Web site. Without this control, you will not see most of the equations. Please do not e-mail me asking why the equations do not display!

[an error occurred while processing this directive]