Un des jeux les plus facile a programmer! Un jeu de potence, dans lequel on doit deviné un nombre avec que le bonhomme soit pendu! Voici la première version que j'ai fait lorsque j'étais adolescent au secondaire.
A l'aide du code source GWBASIC, vous trouvez la réponse que vous souhaitez:
- 10 DIM B$(255),T%(500):SCREEN 1:CLS:COLOR 33:DEF SEG=&HB800
- 20 DRAW"BM10,0C2R30D10L25G5D5F5R15F10D20G10L30U10R25E5U10H5L15H10U15E10BM50,0D65R10U55F10E10D55R10U65L10G10H10L10BM110,10D45F10R20E10U20R5U5L20D5R5D15G5L10H5U35E5R10F5D10R10U15H10L20G10
- 30 DRAW"C2BM160,10D55R10U20R10D20R10U55H10L10G10BM170,10D25R10U25L10BM195,0D65R10U55F10E10D55R10U65L10G10H10L10BM240,0D65R25U10L15U20R10U10L10U15R15U10L25BM280,0R30D10L25G5D5F5R15F10D20G10L30U10R25E5U10H5L15H10U15E10
- 40 DRAW"BM100,118C1D25F4E4U25L7"
- 50 DRAW"BM102,155F25R5U5H25L5D5"
- 60 DRAW"BM135,153D27R8U27H4G4"
- 70 DRAW"BM135,118D25F4E4U25L7"
- 80 DRAW"BM100,163D17R8U17H6L2D6
- 90 DRAW"BM150,118D25F4E4U25L7"
- 100 DRAW"BM152,155F25R5U5H25L5D5"
- 110 DRAW"BM185,153D27R8U27H4G4"
- 120 DRAW"BM185,118D25F4E4U25L7"
- 130 DRAW"BM150,163D17R8U17H6L2D6
- 190 READ F$,G$:A=VAL(F$):B=VAL(G$):IF A=-1 THEN 200 ELSE PAINT(A,B),CHR$(16)+CHR$(44),2:GOTO 190
- 200 READ F$,G$:A=VAL(F$):B=VAL(G$):IF A=-1 THEN 210 ELSE PAINT(A,B),2,1:GOTO 200
- 210 LOCATE 24,4:PRINT"-CREE PAR SYLVAIN MALTAIS (1990)-";
- 220 A$=INKEY$:IF A$="" THEN 220 ELSE IF A$=CHR$(27) OR A$=CHR$(0)+"O" THEN SCREEN 0:WIDTH 80:CLS:END
- 230 COLOR 17:RESTORE 830:SCREEN 1:CLS:FOR A=65 TO 90:READ B$(A):NEXT:X=110:Y=5
- 240 B$(45)="C3BD4BR2R4":B$(40)="C3BR4G2D4F2":B$(41)="C3BR4F2D4G2":B$(48)="C2D8R7U8NG7L7"
- 250 B$(49)="C2BR4NG4D8R3L6":B$(50)="C2R8D4L8D4R8":B$(51)="C2R8D4NL4D4L8":B$(52)="C2D4R8U4D8":B$(53)="C2NR7D4R7D4L7":B$(54)="C2D4R7D4L7U8R7":B$(55)="C2R7D8":B$(56)="C2D8R7U4NL7U4L7":B$(57)="C2D4R7D4NL7U8L7":B$(63)="C2R7D4L4D2BD2U0"
- 260 READ A$:FOR L=1 TO 11:C$=MID$(A$,L,1):DRAW"BM"+STR$(X)+","+STR$(Y)+B$(ASC(C$)):X=X+9:NEXT:X=50:Y=50
- 270 READ A$:IF A$="-1" THEN Y=50:GOTO 280 ELSE FOR L=1 TO LEN(A$):C$=MID$(A$,L,1):DRAW"BM"+STR$(X)+","+STR$(Y)+B$(ASC(C$)):X=X+9:NEXT L:X=50:Y=Y+20:GOTO 270
- 280 GET(50,Y)-(319,Y+10),T%:PUT(50,Y),T%,PRESET
- 290 A$=INKEY$:IF A$="" THEN 290
- 300 PUT(50,Y),T%,PSET:IF A$=CHR$(0)+"H" THEN Y=Y-20 ELSE IF A$=CHR$(0)+"P" THEN Y=Y+20
- 310 IF A$="1" OR A$="2" OR A$="3" OR A$="4" THEN 330
- 320 IF Y<50 THEN Y=110 ELSE IF Y=130 THEN Y=50 ELSE IF A$=CHR$(13) THEN A$=STR$((Y-30)/20):GOTO 340
- 330 GOTO 280
- 340 Z=VAL(A$):ON Z GOTO 790,780,350,800
- 350 SCREEN 1:CLS:COLOR 17:LINE(0,0)-(319,191),3,B:LINE(10,10)-(309,189),3,B:PAINT(1,1),CHR$(197)+CHR$(161),3:GOSUB 750:RANDOMIZE TIMER
- 360 DRAW"BM96,64C3R16L8D16R8L16BM120,80R16U8L16U8R16BM144,64R16L8D16R8L16BM176,64D8R16L8U8D16BM192,64R16D8NL8D8L16BM216,64D8R16L8U8D16BM176,64D8R16L8U8D16BM192,64R16D8NL8D8L16BM216,64D8R16L8U8D16BM96,82R130D3L130U3BM240,116R8D8L8U8"
- 370 DRAW"BM32,88C3R24D16M48,108M56,112D16L24U16M40,108M32,104U16BM64,88R24D16M80,108M88,112D16L24U16M72,108M64,104U16BM40,92R8D8L8U8BM40,116R8D8L8U8BM72,92R8D8L8U8BM72,116R8D8L8U8BM240,92R8D8L8U8":A$="PRESSE UNE TOUCHE POUR CONTINUER..."
- 380 DRAW"BM96,88NR12D8NR8D8R12BM112,88R12D17F2H5F2L12U16BM128,88D16R12U16BM144,88R12L6D16R6L12BM160,104U16R12D8L12BM188,88L12D8NR6D8R12BM200,88D8R16L8U8D16BM232,88R24D16M248,108M256,112D16L24U16M240,108M232,104U16BM264,88R24D40L8U24L16U16"
- 390 DRAW"BM124,112L12D16R12U8L4BM128,128U16R12D8L12M140,128BM144,114R4D4L4U4BM144,122R4D4L4U4BM152,112R12D16L12U16BM180,128U16L8D8R8BM134,132L6D4NR3D4R6BM138,140R6U4L6U4R6BM148,140R6U4L6U4R6BM158,140U8F4E4D8BM272,92R8D8L8U8"
- 400 LINE(32,144)-(288,176),3,B:LOCATE 21,10:PRINT"M. SYLVAIN MALTAIS"
- 410 FOR A=2 TO 38:LOCATE 24,2:PRINT RIGHT$(A$,38-A)LEFT$(A$,A);:Z$=INKEY$:IF Z$="" THEN NEXT:GOTO 410 ELSE GOSUB 420:GOSUB 470:GOSUB 740
- 420 SCREEN 0:WIDTH 40:COLOR 30,1,1:CLS:LOCATE 4,16:PRINT"INSTRUCTION":COLOR 15
- 430 PRINT STRING$(40,"_"):LOCATE 7,9:PRINT"VOUS DEVEZ TROUVER UN NOMBRE"
- 440 LOCATE 9,9:PRINT"DE 0 A 100 QUI SE TROUVE":LOCATE 11,9
- 450 PRINT"DANS LA MEMOIRE VIVE DE":LOCATE 13,9:PRINT"L'ORDINATEUR."
- 460 LOCATE 16,27:PRINT"BONNE CHANCE !":LOCATE 20,9:INPUT"QUEL EST TON NOM ? ",NOM$:IF NOM$="" THEN 460 ELSE SCREEN 1:RETURN
- 470 GOSUB 480:GOSUB 500:RETURN
- 480 CLS:GOSUB 750
- 490 DRAW"BM200,180C3D12R116U12NL116L16U112NG16L64F16R32D96U16G16L24E40BM316,180H16D8F8BM284,100H16R8F8BM244,84D4U12":CIRCLE(243,91),3,3:CIRCLE(244,106),14,3:CIRCLE(244,106),18,3:PAINT(229,100),2,3:RETURN
- 500 X=10:Y=60:C=0:A=INT(100*RND):RESTORE 860:B$=""
- 510 READ A$:IF A$="-1"THEN L=0:X=90:Y=120:GOTO 520 ELSE FOR L=1 TO LEN(A$):C$=MID$(A$,L,1):DRAW"BM"+STR$(X)+","+STR$(Y)+B$(ASC(C$)):X=X+9:NEXT:X=10:Y=Y+20:GOTO 510
- 520 L=L+1:A$=INKEY$:IF L=300 THEN LINE(X,Y)-(X+8,Y+8),3,BF:L=0 ELSE IF L=150 THEN LINE(X,Y)-(X+8,Y+8),0,BF
- 530 IF A$="" THEN 520 ELSE IF A$=CHR$(27) OR A$=CHR$(0)+"O" THEN SCREEN 0:WIDTH 80:END
- 540 IF A$="0" OR A$="1"OR A$="2"OR A$="3"OR A$="4"OR A$="5" OR A$="6" OR A$="7" OR A$="8" OR A$="9" OR A$=" "OR A$=CHR$(8) OR A$=CHR$(0)+"K"OR A$=CHR$(13) THEN 550 ELSE 520
- 550 LINE(X,Y)-(X+8,Y+8),0,BF:IF (A$=CHR$(8) OR A$=CHR$(0)+"K") AND X>90 THEN B$=MID$(B$,1,LEN(B$)-1):X=X-9:LINE(X,Y)-(X+8,Y+8),0,BF:GOTO 520 ELSE IF A$=CHR$(8) OR A$=CHR$(0)+"O" THEN 520
- 560 IF A$=CHR$(13) THEN B=VAL(B$):LINE(90,120)-(120,140),0,BF:B$="":X=90:Y=120:GOTO 590
- 570 B$=B$+A$:DRAW"BM"+STR$(X)+","+STR$(Y)+B$(ASC(A$)):X=X+9
- 580 IF LEN(B$)=3 THEN B=VAL(B$):LINE(90,120)-(120,140),0,BF:B$="":X=90:Y=120:GOTO 590 ELSE 520
- 590 IF A>B THEN LOCATE 20,1:PRINT"NOMBRE TROP PETIT" ELSE IF A=B THEN GOSUB 670 ELSE LOCATE 20,1:PRINT"NOMBRE TROP GRAND"
- 600 C=C+1:ON C GOSUB 620,630,640,650,660,670
- 610 GOTO 520
- 620 CIRCLE(244,105),12,3:CIRCLE(238,102),2,3:CIRCLE(250,102),2,3:CIRCLE(244,106),1,3:DRAW"C3BM238,109R12BM238,114D7BR10U7":PAINT(239,110),1,3:RETURN
- 630 DRAW"C3BM224,122C3M264,122M264,152M224,152M224,122BM245,128M256,128M256,136M250,138M245,136M245,128BM245,130M256,130":PAINT(240,136),3,3:RETURN
- 640 DRAW"C3BM224,122C3M208,122M208,144BM216,144M216,128M224,128BM204,144M218,144M218,148M204,148M204,144BM208,148M208,146BM211,148M211,146BM215,148M215,146":RETURN
- 650 DRAW"C3BM264,122R16D22BM264,128R6M272,144BD8R12D4M275,148BM271,148M271,146BM274,148L2":RETURN
- 660 DRAW"C3BM240,154D30L16M228,154R12":RETURN
- 670 IF A=B THEN 710
- 680 SCREEN 0:WIDTH 80:COLOR 15,1,1:CLS:LOCATE 12,5:PRINT"Tu as échoué":LOCATE 14,20:PRINT"Meilleure chance la prochaine fois !":LOCATE 16,50:PRINT"C'ETAIS"A:PRINT"VEUX TU REJOUE (O)ui/(N)on ?"
- 690 A$=INKEY$:IF A$="N" OR A$="n"THEN 740 ELSE IF A$="O"OR A$="o" THEN SCREEN 1:GOSUB 470:GOSUB 740 ELSE IF A$=CHR$(27) OR A$=CHR$(0)+"O" THEN COLOR 15,0,0:CLS:END ELSE 690
- 700 GOTO 730
- 710 CLS:PRINT"BRAVO TU AS REUSSI":PRINT"Veux tu rejouer (O)ui/(N)on"
- 720 A$=INKEY$:IF A$="N"OR A$="n" THEN 740 ELSE IF A$="O" OR A$="o" THEN GOSUB 470:GOSUB 740 ELSE 720
- 730 RETURN
- 740 CLS:GOTO 230
- 750 DRAW"BM48,16C3D32R8U16R16U16L24BM56,20R8D8L8U8BM80,16C3D32R24U32L24BM88,24D16R8U16L8BM112,16C3D8R8D24R8U24R8U8L24BM112,16C3D8R8D24R8U24R8U8L24BM80,16C3D32R24U32L24BM88,24D16R8U16L8BM112,16C3D8R8D24R8U24R8U8L24BM144,16C3D32R24U8L16U8R16U4L16U4R16U8L24
- 760 DRAW"BM176,16C3D32R8U10M192,48R8U32L8D16M184,16L8BM208,16C3D32R24U8L16U16R16U8L24BM240,16C3D32R24U8L16U8R16U4L16U4R16U8L24":PAINT(49,17),CHR$(176),3
- 770 PAINT(81,17),CHR$(177),3:PAINT(113,17),CHR$(176),3:PAINT(145,17),CHR$(177),3:PAINT(177,17),CHR$(176),3:PAINT(209,17),CHR$(177),3:PAINT(241,17),CHR$(177),3:RETURN
- 780 SHELL"DIGGER"
- 790 SHELL"AV":GOTO 230
- 800 SCREEN 0:WIDTH 80:CLS:END
- 810 DATA 20,8,55,10,115,20,165,20,200,20,245,20,275,20,-1,
- 820 DATA 105,120,107,155,140,160,140,120,190,160,190,120,-1,
- 830 DATA C3BD1D6U4NR5U2ER3F1D6,C3ND7R4FDGNL4FD2GNL4,C3BDD5FR3EUBU3UHL3G,C3D7R4E1U5HL4,C3NR5D3NR4D4R5,C3NR5D3NR4D4,C3BDD5FR3EU2NL2BU2UHL3G,C3D7U4R5NU3D4,C3R4L2D7L2R4,C3BD5DFR3EU6,C3D7U4R3E2NUG2F2D2,C3D7R5,C3ND7F2ND3E2D7
- 840 DATA C3ND7DF5NDU6,C3BDD5FR3EU5HL3G,C3ND7R4FD2GL4,C3BDD5FR3EU5HL3GD4BR3F2,C3ND7R4FDGNL4FD3,C3BDDFR3FD2GL3HBU5ER3F,C3R4L2D7,C3D6FR3EU6,C3D5F2E2U5,C3D7E2NU5F2U7,C3DF5DBL5UE5U,C3D2F2ND3E2U2,C3R5DG5DR5
- 850 DATA SM GAMES VI,F(1)-VOLLEY ARCADE,F(2)-DIGGER,F(3)-POTENCE,F(4)-POUR RETOURNER AU MS-DOS,-1
- 860 DATA DEVINE LE NOMBRE,ENTRE 1 ET 100,QUEL EST TON NOMBRE ?,-1
Dernière mise à jour : Samedi, le 24 janvier 2015