Here is a code for a fight simulator (PLAYERS=NO. PLAYERS): Code: DIM STRENGTH(PLAYERS) FOR A=1 TO PLAYERS STRENGTH(A)=A NEXT A 1 FOR A=1 TO PLAYERS CLS IF (STRENGTH(A)<0)) THEN GOTO 2 PRINT "PLAYER:";A PRINT "STRENGTH:";STRENGTH(A) INPUT "PLAYER:",PLAYER IF (PLAYER=0) THEN END PRINT "STRENGTH:";STRENGTH(PLAYER) PRINT "MINIMUM STRIKE:";STRENGTH(A)-(STRENGTH(A)*2) PRINT "MAXIMUM STRIKE:";STRENGTH(A) INPUT "STRIKE:",STRIKE IF (STRIKE>STRENGTH(A)) THEN GOTO 2 IF (STRIKE<STRENGTH(A)-(STRENGTH(A)*2) THEN GOTO 2 STRENGTH(PLAYER)=STRENGTH(PLAYER)+STRIKE 2 NEXT A GOTO 1 The program simply goes through the players requesting their move: the player selects another player which they can then strike; the player may add value to the selected player's health, or deduct from it.
Pseudocode, or broken BASIC? I didn't remember CLS being a valid command, but it is indeed. Who writes in BASIC these days? I mean really. COBOL is much more fun to code... Please Register or Log in to view the hidden image!