Naval Game

Arrojeria, Eustakio

Elhuyar Zientziaren Komunikazioa

Lizaso, Pili

Informatika Saila

Elhuyar Fundazioa

Games are often the sites that most like or like computers. The program we propose here is the so-called "naval game".

Games are often the sites that most like or like computers. The program we propose here is the so-called "naval game".

Unless the playing area is 10x10 instead of 12x12 and the user has a limit of 50 shots, the rules are normally accepted.

The machine will indicate to the user whether it has hit or failed and will consider it a winner or loser, as appropriate.

Note: This game is scheduled for use on PC and compatible.

10 NAVAL
GAMES REM 20 SCREEN 1: KEY OFF: CLS
30 DIM A(12,12): DIM UNTZI$(10,4)
40 REM
50 LOCATE 4,8: PRINT "RULES OF THE GAME OF THE


SHIPS UNDER 11,600 PRINT "- Give us the coordinates of
the boat" 90 LOCATE 12,6: PRINT " (letter, number)."
100 LOCATE 14.4: PRINT "- If you touch the boat, asterisk"
110 LOCATE 15,6: PRINT will become a "diamond".
120 LOCATE 17.4: PRINT "- If it fails,
desis asteriso-" 130 LOCATE 18,6: PRINT "close."
140 GOSUB 1600: FOLLOW REM
150 CLS
160 LOCATE 5.5: PRINT "Let's see what the opponent
is" 170 LOCATE 7.5: PRINT "fleet:"
180 LOCATE 9,5: PRINT "- One plane (4 asterisks)"
190 LOCATE 11,5: PRINT "- Two battleships (3 asterisks)"
200 LOCATE 13,5:- PRINT "- Three destroyers (2 asterisks)"
210 LOCATE 15,5: PRINT "- 4 shots


240
250 LOCATE 15,14 PRINT!
260 GOSUB 1600: To execute the rules of the game REM
270 CLS
280 AMAIA to follow Rem
290 REM BIGIZTA
300 ERREKOP = 1: LENGTH = 4: A = 1
310
FOR I = 1 TO 12:1A(I) = 1











II(1 MONTH





OF




NOVEMBER AND













MONTH OF NAVARRA) PRINT "ABCDEFGHIJ"





















910 FOR I=7 TO 16: LOCATE I,13 PRINT I-7: NEXT I
920


REM

PLACE OF CONVECTION AMAIA
980 LOCATE 20,5: Input "Letter:",X$
990 LOCATE 20,5: PRINT
SPC(15) 1000 IF (ASC(X$) 64) AND (ASC(X$) 75) THEN 1050
1010 LOCATE 22,5: PRINT "View
letters" 1020 N =
500: GOSUB 1650: REM
G20
LOCATE: 1020,50 INPUT "Number:",Y$
1060 LOCATE 20,5: 1$













IN












THM=1RF





ELSE LOCATE 22,7:PRINT "RETOUCHED!!!"
1360 N = 500: GOSUB 1650: PAUSE REM
1370 LOCATE 22,7: PRINT SPC(17)
1380 GOTO 1440
1390 WATER = WATER + 1
1400 LOCATE ASC(Y$)-41,ASC(X$)-49: PRINT "
1410 LOCATE 22,7: PRINT "You have failed!!!"
1420 N = 500: GOSUB 1650: PAUSE REM
1430 LOCATE 22,7: PRINT SPC(20)
1440 GOTO 950
1450 REM AMBITARTE
1460 IF UKI 20 THEN 1500
1470 LOCATE 20,7:PRINT "You have submerged all the ships"
1480 LOCATE 22,7: You have won shots!!!"
1490 GOTO 1540
1500 LOCATE 19,5:PRINT SPC(30)
1510 LOCATE 20,7:PRINT "Sorry but you lose it"
1520 LOCATE 21,7:PRINT "You already have more than 50
shots" 1530 LOCATE 22,7: PRINT "you've shot more."
1540 N = 2000: GOSUB 1650: TO CALCULATE IF YOU
HAVE TOUCHED 1550 REM AMAIA OR HAVE NOT TAKEN PAUSE
1560 CLS
1570 LOCATE 11,11: PRINT "FINISHED GAME."
1580 END
1590 Continuation action of the naval game AMAYA
1600 REM
1610 LOCATE 23,10: PRINT "Press J to continue"
1620 TE$=":WHILE TE$ "J" AND TE$ "j":TE$=INKEY$:ACTION WEND
1630 RETURN
1640 REM PAUSE
1650

PAUSE
1660
K = 1
1670 FOR
1690 TO EXN

Babesleak
Eusko Jaurlaritzako Industria, Merkataritza eta Turismo Saila