Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mugwump Game
#1
I thought it about time I dug this old game out and corrected the OCR errors. It could probably be compiled with FB. Use Remline.bas to delete unwanted line numbers.

Gordon

Code:
1 REM     COURTESY PEOPLE'S COMPUTER COMPANY

2 WIDTH 80, 25: SCREEN 0: PRINT TAB(33); "MUBWUMP"
3 PRINT TAB(15); "CREATIVE CONPUTINB MORRISTOUN, NEW JERSEY"
4 PRINT : PRINT : PRINT
10 DIM P(4, 2)
20 PRINT "THE OBJECT OF THIS GAME IS TO FIND FOUR MUGWUMPS"
30 PRINT "HIDDEN ON A 10 BY 10 GRID. HOMEBASE IS POSITION 0,0"
40 PRINT "ANY GUESS YOU MAKE MUST BE TWO NUMBERS WITH EACH"
50 PRINT "NUMBER BETWEEN 0 AND 9, INCLUSIVE. FIRST NUMBER"
60 PRINT "IS DISTANCE TO RIGHT OF HOMEBASE AND SECOND NUMBER"
70 PRINT "IS DISTANCE ABOVE HOMEBASE."
80 PRINT
90 PRINT "YOU GET 10 TRIES. AFTER EACH TRY, I WILL TELL"
100 PRINT "YOU HOW FAR YOU ARE FROM EACH MUGWUMP."
110 PRINT
240 GOSUB 1000
250 T = O
260 T = T + 1
270 PRINT
275 PRINT
290 PRINT "TURN NO."; T; "WHAT IS YOUR GUESS";
300 INPUT M, N
310 FOR I = l TO 4
320 IF P(I, 1) = -1 THEN 400
330 IF P(I, 1) <> M THEN 380
340 IF P(I, 2) <> M THEN 380
350 P(I, 1) = -1
360 PRINT "YOU HAVE FOUND MUGBWUMP"; I
370 GOTO 400
380 D = SQR((P(I, 1) - M) ^ 2 + (P(I, 2) - M) ^ 2)
390 PRINT "YOU ARE"; (INT(D * 10)) / 10; "UNITS FROM MUGWUMP"; I
400 NEXT I
410 FOR J = 1 TO 4
420 IF P(J, 1) <> -l THEN 470
430 NEXT J
440 PRINT
450 PRINT "YOU GOT THEM ALL IN"; T; "TURNS!"
460 GOTO 580
470 IF T < 10 THEN 260
480 PRINT
490 PRINT "SORRY, THAT'S 10 TRIES. HERE IS VHERE THEY'RE HIDING"
540 FOR I = 1 TO 4
550 IF P(I, 1) = -1 THEN 570
560 PRINT "MUGWUMP"; I; "IS AT "; P(I, 1); ","; P(I, 2); ")"
570 NEXT I
580 PRINT
600 PRINT "THAT WAS FUN! LET'S PLAY AGAIN ......"
610 PRINT "FOUR MORE MUGWUMPS ARE NOW IN HIDING."
630 GOTO 240
1000 FOR J = 1 TO 2
1010 FOR I = l TO 4
1020 P(I, J) = INT(10 * RND(1))
1030 NEXT I
1040 NEXT J
1050 RETURN
1099 END
Reply
#2
Gordon:

Seems very difficult, if one is to really "guess" at the coordinates each time. Or, is it O.K. to do a table of distances and possible coordinates for each of the Mugwumps first? Even so, it might be too difficult to get all Mugwumps in just ten "guesses"! I'll give this a second go-around later, with the help of such a table, and see if I can win.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#3
Have a word with

CREATIVE CONPUTINB MORRISTOWN, NEW JERSEY"

They produced the book.

I will look and see if any others are worth posting

Gordon
Reply
#4
Gordon:

I'm back. I tried to play the game, and had problems, so, I started to analyse it. I found several important errors, as follows:

310
340 IF P(I, 2) <> M THEN 380
The "M" should be an "N"

Lines 330-390 are so messed up, in my opinion, that I redid them:
320 IF P(I,1) = -1 THEN 400
IF P(I,1) = M AND P(I,2) = N THEN 'new line
350 P(I,1)=-1
360 PRINT "YOU HAVE FOUND MUGWUMP";I
ELSE 'new line
380 D = SQR((I,1)-M)^2 + (P(I,2 - N)^2) 'changed 2nd M to N
390 PRINT "YOU ARE"; (INT(D*10+.5))/10;"UNITS FROM MUGWUMP";I
END IF 'new line

1010 FOR I = l TO 4
The "l" should be a "1".

With the above changes, the game gave correct results, but, after cheating and finding all four Mugwumps in five guesses, the game asked me for the 6th guess, so, it needs more fixing. That's when I gave up. Maybe you should look at your book and fix these little errors before publishing? It sure would make life easier for us!
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)