Herramientas de usuario

Herramientas del sitio


es:office_battleships

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
es:office_battleships [2022/06/30 00:17] – [Capturas] jevicaces:office_battleships [2022/06/30 00:23] (actual) – [Descripción] jevicac
Línea 19: Línea 19:
 ===== Descripción ===== ===== Descripción =====
  
 +Son las cuatro y media de la tarde de un viernes en el corazón de un ajetreado centro de la ciudad. Usted, el jefe de una gran empresa comercial, tiende a aburrirse bastante simplemente sentado allí contando los clips de papel, por lo que su alegría es abrumadora cuando llega un mensaje a través de su máquina de télex.
 +
 +El mensaje dice:
 +
 +Estimado,
 +
 +¿Estarías interesado en un pequeño juego conmigo para pasar el rato?
 +¿horas? Si es así, encienda su computadora e inicie sesión en el mainframe de su empresa: área de usuario 1K97.
 +
 +Atentamente, A. Rival.
 +
 +Después de haber seguido estas instrucciones, ahora está sentado frente a la terminal de su computadora e inició sesión. La pantalla muestra dos cuadrículas y se le indica que ingrese las ubicaciones de varios muebles de su oficina. Solo ahora te das cuenta de que estás jugando a una versión del juego Battleships, y tu oponente comienza el juego dándote una referencia de cuadrícula y preguntándote si anotó un acierto o un error.
 +
 +Si es un acierto, se le pedirá que ingrese un valor correspondiente al acierto del mueble. Una vez hecho esto, o si su oponente falló, se le pide que ingrese una referencia de cuadrícula para intentar golpear el equipo de su adversario. La computadora central, que realiza un seguimiento del juego, le informará si se anotó un golpe.
 +
 +El juego continúa hasta que una de las oficinas está completamente vacía y se anuncia el ganador. Sin embargo, tenga cuidado, el mainframe detendrá el juego si hace trampa.
  
  
Línea 27: Línea 43:
 <file> <file>
  
- +10 REM        Office Battleships 
 +20 REM          by John Filsak 
 +30 REM (c) Computing with the Amstrad  
 +40 REM ------------ PCW ------------- 
 +50 RANDOMIZE PEEK(64504!):e$=CHR$(27):cls$=e$+"E"+e$+"H":ron$=e$+"p":rof$=e$+"q" 
 +60 uon$=e$+"r":DEFINT a-z:uof$=e$+"u"  
 +70 cof$=e$+"f":con$=e$+"e" 
 +80 DEF FNat$(x,y)=e$+"Y"+CHR$(x+32)+CHR$(y+32) 
 +90 DIM h(6),h1(6),a$(6),p0$(9,9),p1$(9,9),p2$(9,9),p3$(9,9),na$(6) 
 +100 GOSUB 1740:PRINT cof$:k=1:WHILE k=1  
 +110 PRINT cls$;ron$;" OFFICE-BATTLESHIPS "rof$;" Please wait while I arrange my furniture." 
 +120 GOSUB 1790:GOSUB 180:GOSUB 630  
 +130 GOSUB 350:GOSUB 840:GOSUB 1860  
 +140 PRINT FNat$(30,0);"Play again? Y/N" 
 +150 ans$="YN":GOSUB 1840 
 +160 WEND:PRINT cls$;con$:END 
 +170 REM Opponent's furniture 
 +180 FOR a=6 TO 0 STEP-1:z=(RND*2)+1  
 +190 ON z GOSUB 210,280:NEXT:RETURN  
 +200 REM Vertical 
 +210 x=(RND*10)-a:IF x<0 THEN 210  
 +220 y=(RND*9):b=0 
 +230 IF x+b>9 THEN 210 
 +240 IF p0$(x+b,y)="L" OR p0$(x+b,y)="P" OR p0$(x+b,y)="D" OR p0$(x+b,y)="T" OR p0$(x+b,y)="F" OR p0$(x+b,y)="C" THEN 210 
 +250 b=b+1:IF b<=a THEN 230 
 +260 FOR c=0 TO a:p0$(x+c,y)=a$(a):NEXT:RETURN 
 +270 REM Horizontal 
 +280 y=(RND*10)-a:IF y<0 THEN 280  
 +290 x=(RND*9):b=0 
 +300 IF y+b>9 THEN 280 
 +310 IF p0$(x,y+b)="L" OR p0$(x,y+b)="P" OR p0$(x,y+b)="D" OR p0$(x,y+b)="T" OR p0$(x,y+b)="F" OR p0$(x,y+b)="C" THEN 280  
 +320 b=b+1:IF b<=a THEN 300 
 +330 FOR c=0 TO a:p0$(x,y+c)=a$(a):NEXT:RETURN 
 +340 REM Players furniture 
 +350 PRINT FNat$(17,0);"My furniture is in position." 
 +360 PRINT:PRINT"Now you position yours."  
 +370 PRINT:PRINT"Press a key to continue.":WHILE INKEY$="":WEND 
 +380 FOR a=6 TO 0 STEP-1:GOSUB 1820 
 +390 PRINT FNat$(17,0);"Where would you like to position your ";na$(a);" ("; 
 +400 FOR z=0 TO a:PRINT a$(a);:NEXT:PRINT")?":PRINT "X co-ordinate (0 to 9) ?"; 
 +410 GOSUB 1830:x=k-1:PRINT x 
 +420 PRINT"Y co-ordinate (0 to 9) ?";  
 +430 GOSUB 1830:y=k-1:PRINT y 
 +440 IF a>0 THEN PRINT"Horizontal or Vertical ?";:ans$="HV":GOSUB 1840:PRINT MID$(ans$,k,1) 
 +450 IF k=1 THEN 520 
 +460 REM Vertical 
 +470 b=0:IF x+a>9 THEN GOSUB 600:GOTO 390  
 +480 IF p1$(x+b,y)="L" OR p1$(x+b,y)="S" OR p1$(x+b,y)="D" OR p1$(x+b,y)="T" OR p1$(x+b,y)="F" OR p1$(x+b,y)="C" THEN GOSUB 600:GOTO 390 
 +490 b=b+1:IF b<=a THEN 480 
 +500 FOR c=0 TO a:p1$(x+c,y)=a$(a):NEXT:GOTO 560 
 +510 REM Horizontal 
 +520 b=0:IF y+a>9 THEN GOSUB 600:GOTO 390  
 +530 IF p1$(x,y+b)="L" OR p1$(x,y+b)="S" OR p1$(x,y+b)="D" OR p1$(x,y+b)="T" OR p1$(x,y+b)="F" OR p1$(x,y+b)="C" THEN GOSUB 600:GOTO 390 
 +540 b=b+1:IF b<=a THEN 530 
 +550 FOR c=0 TO a:p1$(x,y+c)=a$(a):NEXT  
 +560 FOR p=0 TO 9:FOR q=0 TO 9 
 +570 IF p1$(p,q)<>"" THEN PRINT FNat$(13-p,4+q*2);p1$(p,q) 
 +580 NEXT:NEXT:NEXT:GOSUB 1820 
 +590 d$="Your":x=2:y=27:GOSUB 810:RETURN  
 +600 GOSUB 1820:PRINT FNat$(17,0);CHR$(7);"It won't fit there." 
 +610 GOSUB 1860:RETURN 
 +620 REM Draw grids 
 +630 PRINT FNat$(0,0);ron$;SPC(89);rof$  
 +640 title$="* * * O F F I C E - B A T T L E S H I P S * * *" 
 +650 PRINT FNat$(0,(89-LEN(title$))/2);ron$;title$;rof$ 
 +660 PRINT FNat$(2,7);ron$;" YOUR OFFICE "rof$; 
 +670 PRINT FNat$(8,0);"X";FNat$(15,13);"Y"  
 +680 FOR a=0 TO 9:PRINT FNat$(13-a,1);a  
 +690 PRINT FNat$(13-a,46);
 +700 PRINT FNat$(14,3+a*2);
 +710 PRINT FNat$(14,48+a*2);
 +720 FOR b=0 TO 9 
 +730 PRINT FNat$(13-a,4+b*2);":" 
 +740 PRINT FNat$(13-a,49+b*2);":":NEXT:NEXT 
 +750 PRINT FNat$(2,53);ron$;" MY OFFICE ";rof$ 
 +760 PRINT FNat$(8,45);"X";FNat$(15,58);"Y" 
 +770 d$="My":x=2:y=72:GOSUB 810:RETURN 
 +780 FOR a=0 TO 9:FOR b=0 TO 9 
 +790 IF p0$(a,b)="" THEN PRINT FNat$(13-a,49+b*2);":" ELSE PRINT FNat$(13-a,49+b*2);p0$(a,b) 
 +800 NEXT:NEXT:RETURN 
 +810 PRINT FNat$(x,y);uon$;d$;" objects";uof$;FN at$(x+1,y);uon$;"not destroyed:";uof$ 
 +820 FOR g=0 TO 6:n$=na$(g):n$=UPPER$(LEFT$(n$,1))+RIGHT$(n$,LEN(n$)-1) 
 +830 PRINT FNat$(x+g+4,y);n$:NEXT:RETURN  
 +840 REM Your go or opponent's go? 
 +850 PRINT FNat$(16,0); 
 +860 PRINT"Press a key":WHILE INKEY$="":WEND 
 +870 go=0:empty=0:empty1=0:WHILE empty=0 AND empty1=0 
 +880 go=go+1:IF go/2<>INT(go/2) THEN GOSUB 1190 ELSE GOSUB 950 
 +890 WEND 
 +900 IF empty=1 THEN PRINT FNat$(17,0);CHR$(7);"You have destroyed all my furniture. I surrender" 
 +910 IF empty1=1 THEN PRINT FNat$(17,0);CHR$(7);"I have destroyed all your furniture. You have lost.":GOSUB 1860 
 +920 PRINT:PRINT"Would you like to see where all furniture was ? (Y/N)":ans$="YN":GOSUB 1840:IF k=1 THEN GOSUB 780 
 +930 RETURN 
 +940 REM Your go 
 +950 PRINT:PRINT"Type the co-ordinates of the spot you want to blast." 
 +960 PRINT"X co-ordinate (0-9) ?";:GOSUB 1830:x=k-1:PRINT x 
 +970 PRINT"Y co-ordinate (0-9) ?";:GOSUB 1830:y=k-1:PRINT y 
 +980 GOSUB 1820:empty$="":hit$="" 
 +990 IF p2$(x,y)<>"" THEN PRINT FNat$(17,0);CHR$(7);"You have already tried that postion. Pick another.":GOTO 950 
 +1000 p2$(x,y)=p0$(x,y) 
 +1010 IF p2$(x,y)="" THEN p2$(x,y)="*":PRINT FNat$(17,0);"Missed!" 
 +1020 FOR z=6 TO 0 STEP-1 
 +1030 IF p2$(x,y)=a$(z) THEN hit$=na$(z):h(z)=h(z)-1 
 +1040 NEXT 
 +1050 IF hit$<>"" THEN PRINT FNat$(17,0);"You hit my ";hit$;".":GOSUB 1850 
 +1060 FOR z=6 TO 0 STEP-1 
 +1070 IF hit$=na$(z) AND h(z)=0 THEN PRINT CHR$(7):PRINT"You have destroyed my ";hit$".":empty$=UPPER$(LEFT$(hit$,1)):GOSUB 1850 
 +1080 NEXT 
 +1090 FOR i=0 TO 9:FOR j=0 TO 9 
 +1100 IF empty$<>"" THEN IF p0$(i,j)=empty$ THEN p2$(i,j)="$" 
 +1110 NEXT:NEXT 
 +1120 IF empty$<>"" THEN PRINT FNat$(6+INSTR(initial$,empty$)-1,72);SPACE$(16)  
 +1130 FOR i=0 TO 9:FOR j=0 TO 9 
 +1140 IF p2$(i,j)<>"" THEN PRINT FNat$(13-i,49+j*2);p2$(i,j) 
 +1150 NEXT:NEXT 
 +1160 IF h(6)=0 AND h(5)=0 AND h(4)=0 AND h(3)=0 AND h(2)=0 AND h(1)=0 AND h(0)=0 THEN GOSUB 1820:empty=1:RETURN 
 +1170 GOSUB 1820:PRINT FNat$(17,0);"Now is my turn.":RETURN 
 +1180 REM Opponent's go 
 +1190 check=0:GOSUB 1580 
 +1200 IF check=1 THEN GOSUB 1620:GOTO 1220 
 +1210 xx=INT(RND*10):yy=INT(RND*10):IF p3$(xx,yy)<>"" THEN 1210 
 +1220 PRINT:PRINT"I am aiming a shot at your grid position X";xx;", Y;yy 
 +1230 PRINT:PRINT"Is it a hit or a miss? (H/M)" 
 +1240 k=0:k$="":WHILE k=0 OR k$="" 
 +1250 IF p1$(xx,yy)="" THEN PRINT FNat$(13-xx,4+yy*2);":":GOSUB 1850 ELSE PRINT FNat$(13-xx,4+yy*2);p1$(xx,yy):GOSUB 1850  
 +1260 IF p1$(xx,yy)="" THEN PRINT FNat$(13-xx,4+yy*2);ron$;":";rof$:GOSUB 1850 ELSE PRINT FNat$(13-xx,4+yy*2);ron$;p1$(xx,yy);rof$:GOSUB 1850 
 +1270 k$=UPPER$(INKEY$):k=INSTR("HM",k$):WEND:GOSUB 1820 
 +1280 IF k=2 THEN c$="":PRINT"Please confirm: I have missed. (Y/N)":ans$="YN":GOSUB 1840:IF k=2 THEN GOSUB 1820:GOTO 1230 ELSE 1350 
 +1290 IF k=1 THEN GOSUB 1380 
 +1300 IF k=11 AND k1=7 THEN c$="":GOTO 1350 
 +1310 IF k=11 THEN h1(k1)=h1(k1)-1 
 +1320 IF k=12 THEN PRINT:PRINT"Have I hit or missed?  (H/M)":GOTO 1240 
 +1330 IF c$="hit" THEN p3$(xx,yy)="#" :GOSUB 1480 
 +1340 IF h1(k1)=0 THEN GOSUB 1510 
 +1350 IF c$="" THEN p3$(xx,yy)="*":GOSUB 1480 
 +1360 GOSUB 1820:IF empty1=0 THEN PRINT FNat$(17,0);"Now its your turn." 
 +1370 RETURN 
 +1380 c$="hit":PRINT"What have I hit?" 
 +1390 FOR g=0 TO 7:IF g=7 THEN n$="nothing" ELSE n$=na$(g) 
 +1400 n$=UPPER$(LEFT$(n$,1))+RIGHT$(n$,LEN(n$)-1) 
 +1410 PRINT TAB(4)g+1;") ";n$:NEXT 
 +1420 PRINT "Type the number corresponding to the vessel I have hit. "; 
 +1430 ans$="12345678":GOSUB 1840:k1=k-1:GOSUB 1820 
 +1440 IF k=8 THEN PRINT FNat$(17,0);"Please confirm: I have missed.  (Y/N)" 
 +1450 IF k<8 THEN IF h1(k1)=0 THEN PRINT CHRS(7)"Don't be daft. Your ";na$(k1);" is at the bottom of the sea!":GOSUB 1860:GOSUB 1820:GOTO 1380 
 +1460 IF k<8 THEN PRINT FNat$(17,0);"Please confirm: I have hit your ";na$(k1)". (Y/N)" 
 +1470 ans$="YN":GOSUB 1840:k=k+10:RETURN  
 +1480 FOR p=0 TO 9:FOR q=0 TO 9 
 +1490 IF p3$(p,q)<>"" THEN PRINT FNat$(13-p,4+q*2);p3$(p,q) 
 +1500 NEXT:NEXT:RETURN 
 +1510 PRINT FNat$(20,0);CHR$(7);"I have destroyed your ";na$(k1) 
 +1520 down=0:FOR i=0 TO 9:FOR j=0 TO 9  
 +1530 IF p1$(i,j)=a$(k1) THEN p3$(i,j)="$" 
 +1540 NEXT:NEXT 
 +1550 PRINT FNat$(6+k1,27);SPACE$(16):GOSUB 1480 
 +1560 IF h1(0)=0 AND h1(1)=0 AND h1(2)=0 AND h1(3)=0 AND h1(4)=0 AND h1(5)=0 AND h1(6)=0 THEN GOSUB 1820:empty1=1 
 +1570 RETURN 
 +1580 FOR i=0 TO 9:FOR j=0 TO 9 
 +1590 IF p3$(i,j)="#" THEN check=1:RETURN  
 +1600 NEXT:NEXT:RETURN 
 +1610 REM Calculate move after hit scored  
 +1620 IF down=1 THEN 1700 
 +1630 IF j+1<10 THEN xx=i:yy=j+1:IF p3$(xx,yy)="" THEN RETURN 
 +1640 FOR t=2 TO 9:IF p3$(xx,yy)="#" AND xx=i THEN IF j+t<10 THEN yy=j+t:IF p3$(xx,yy)="" THEN RETURN 
 +1650 NEXT 
 +1660 IF j-1>=0 AND xx=i THEN yy=j-1:IF p3$(xx,yy)="" THEN RETURN 
 +1670 IF i+1<10 THEN yy=j:xx=i+1:IF p3$(xx,yy)=""THEN RETURN 
 +1680 FOR t=2 TO 9:IF p3$(xx,yy)="#" AND yy=j THEN IF i+t<10 THEN xx=i+t:IF p3$(xx,yy)="" THEN RETURN 
 +1690 NEXT 
 +1700 IF i-1>=0 THEN yy=j:xx=i-1:IF p3$(xx,yy)="" THEN down=1:RETURN 
 +1710 PRINT FNat$(9,0);CHR$(7);ron$;"I can't find your furniture." 
 +1720 PRINT " You must have made a mistake. Please start again.";rof$;con$:END  
 +1730 REM Assorted subroutines 
 +1740 FOR a=0 TO 6:READ na$(a):NEXT 
 +1750 initial$="HCFTDPL":FOR a=0 TO 6:a$(a)=MID$(initial$,a+1,1):NEXT:RETURN 
 +1760 DATA hat stand,chair,filing cabinet  
 +1770 DATA telex machine,drinks cabinet  
 +1780 DATA photocopier,large oak desk  
 +1790 FOR a=0 TO 6:h(a)=a+1:h1(a)=a+1  
 +1800 NEXT:FOR a=0 TO 9:FOR b=0 TO 9 
 +1810 p0$(a,b)="":p1$(a,b)="":p2$(a,b)="":p3$(a,b)="":down=0:NEXT:NEXT:RETURN  
 +1820 PRINT FNat$(17,0);e$+"J":RETURN 
 +1830 ans$="0123456789" 
 +1840 k=0:k$="":WHILE k=0 OR k$="":k$=UPPER$(INKEY$):k=INSTR(ans$,k$):WEND:RETURN  
 +1850 FOR temp=1 TO 800:NEXT:RETURN 
 +1860 FOR temp=0 TO 2500:NEXT:RETURN
  
 </file> </file>
Línea 33: Línea 234:
 ===== Controles ===== ===== Controles =====
  
-        N = NORTE +        A través de la información en pantalla.
-        S = SUR +
-        E = ESTE +
-        W = OESTE +
-        L = OBSERVAR +
-        I = INVENTARIO +
-        TOMAR, SALTAR, GOLPEAR, DECIR...+
  
 ===== Carga del programa ===== ===== Carga del programa =====
Línea 52: Línea 247:
   * Listado del programa en revista de gran tirada de la época   * Listado del programa en revista de gran tirada de la época
  
-{{:otros:Office_Battleships_01.jpg?170}} {{:otros:Office_Battleships_02.jpg?170}}+{{:otros:Office_Battleships_01.jpg?170}} {{:otros:Office_Battleships_02.jpg?170}} {{:otros:Office_Battleships_03.jpg?170}}
  
 ===== Descarga ===== ===== Descarga =====
  
   * {{:otros:Office_Battleships.zip|Office_Battleships }}(juego en formato dsk, comprimido con zip)   * {{:otros:Office_Battleships.zip|Office_Battleships }}(juego en formato dsk, comprimido con zip)
es/office_battleships.1656537444.txt.gz · Última modificación: 2022/06/30 00:17 por jevicac