Hello all,
I am having a blast playing with my Altair Clone in CP/M.
I have a couple of fun programs that I like to play with whenever I am playing on a new system or playing around with a new programming language. Here's the first one - it figures out how many ways to make US $1.00 from change. This code is for MBASIC on CP/M:
100 REM HOW MANY WAYS TO MAKE $1.00 FROM CHANGE
110 REM
199 C=0
200 FOR P=0 TO 100 STEP 5
210 FOR N=0 TO 20
220 FOR D=0 TO 10
230 FOR Q=0 TO 4
240 IF (P+(N*5)+(D*10)+(Q*25))=100 THEN PRINT P;"PENNIES ";N;"NICKELS ";D;"DIMES ";Q;"QUARTERS" : C=C+1
250 NEXT Q
260 NEXT D
270 NEXT N
280 NEXT P
300 PRINT : PRINT C;"WAYS TO MAKE A DOLLAR FROM CHANGE"
310 END
So give it a try. It's fun to see how long different machines and different languages take to get this done. You can see that I cheated a little bit by putting in a "step 5" in the loop for pennies to shorten up the time a little bit.
What fun programs are you folks playing around with? Maybe you'd like to share one, too?
smp