Hang_Anne

Discuss Programming / Linux questions.

Moderators: scallenger, Sky, TresCom Support Team

Post Reply
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6121
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Hang_Anne

Post by Rebel »

T'was bored, so here's a jp/tres related hangman game. Text-
based, source files included....

http://www.geocities.com/lastrebel41/Hang_Anne.zip
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Post by machf »

Hmmm... I still have my two-player BASIC Hangman lying around on my HDD:

Code: Select all

10 PLAY "mb": INPUT P$: P$ = LCASE$(P$)
20 L = LEN(P$): X$ = ""
25 FOR N = 1 TO L: X$ = X$ + "-": NEXT
27 CLS : LOCATE 10, 20: PRINT X$: L$ = STRING$(26, " "): X = 0
30 a$ = INKEY$: a$ = LCASE$(a$)
40 IF a$ < "a" OR a$ > "z" THEN 30
45 LOCATE 20, 10: PRINT SPC(25);
50 C = ASC(a$) - 96: IF INSTR(L$, a$) THEN LOCATE 20, 10: PRINT "Esa letra ya la usaste...": GOTO 30
55 MID$(L$, C, 1) = a$: LOCATE 5, 32: PRINT L$: a = 1
60 K = INSTR(a, P$, a$): IF a = 1 AND K = 0 THEN X = X + 1: ON X GOSUB 200, 210, 220, 230, 240, 250, 260, 270, 280, 290: LOCATE 7, 64: PRINT X; "fallas": IF X = 10 THEN GOTO 100 ELSE GOTO 30
70 IF K THEN MID$(X$, K, 1) = a$: IF K < L THEN a = K + 1: GOTO 60
75 LOCATE 10, 20: PRINT X$: IF X$ = P$ THEN PLAY "o3c2g2fed>c2<g4.p8fed>c2<g4.p8fefd": LOCATE 20, 10: PRINT "­Felicidades, desgraciado! ­Adivinaste!": END
80 GOTO 30
100 PLAY "o1c4.p8c4.p16ccp16d4c+c+cc<b>c": LOCATE 20, 20: PRINT "­Est s muerto!"
110 LOCATE 21, 20: PRINT "La palabra era: "; P$: END
200 LOCATE 13, 5: PRINT "ÉÍÍ": FOR V = 14 TO 17: LOCATE V, 5: PRINT "º": NEXT: LOCATE 18, 5: PRINT "Ð": RETURN
210 LOCATE 13, 8: PRINT "Ñ": RETURN
220 LOCATE 14, 8: PRINT CHR$(2): RETURN
230 LOCATE 15, 8: PRINT "Ã…": RETURN
240 LOCATE 15, 7: PRINT "Ú": RETURN
250 LOCATE 15, 9: PRINT "¿": RETURN
260 LOCATE 16, 8: PRINT "Á": RETURN
270 LOCATE 16, 7: PRINT "Ú": LOCATE 17, 7: PRINT "Ù": RETURN
280 LOCATE 16, 9: PRINT "¿": LOCATE 17, 9: PRINT "À": RETURN
290 LOCATE 14, 8: PRINT CHR$(1): RETURN

Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6121
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Post by Rebel »

If I used goto in c++ code, I'd be hung! :o

Is that the entire program?
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Post by machf »

Yep, it's short and simple.

Well, those GOTO 30 statements are simply the main loop; the GOTO 60 is checking for more than one ccurrence of a single letter within the word, and the GOTO 100 is the "you lose" case...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6121
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Post by Rebel »

Basic reminds me of Dos. It's been so long since I've screwed with
it, but there's a definite structural similarity there.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Post by machf »

This isn't even QuickBASIC, it's GW-BASIC... wow, this program is really old! I remember writing it in AtariBASIC on my 800XL first, later porting it to the PC.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6121
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Post by Rebel »

Going way back, early eighties, I wrote a few copycat games based
on early arcades. Tank battle, asteriods - they were pretty horrible
copies though. That was all Dos stuff, I didn't even use Windows3.
1 back then even though I think it was available.
Christopher
Velociraptor
Velociraptor
Posts: 1325
Joined: Mon Nov 11, 2002 1:07 pm
Location: Canberra, Australia

Post by Christopher »

Nice little game Rebel :)

But I ran into a bit of a bug...

[Spoilers for those who don't want one of the answers revealed]

The game didn't seem to recognise one letter being in several locations. For the answer "John Hammond" I had to enter 'h' twice, 'o' twice, 'n' twice and 'm' twice. I don't know if you intended this or not.

Still a fun little program :)
Ah, there's nothing more exciting than science. You get all the fun of sitting still, being quiet, writing down numbers, paying attention... Science has it all." - Principal Skinner.
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6121
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Post by Rebel »

The game didn't seem to recognise one letter being in several locations. For the answer "John Hammond" I had to enter 'h' twice, 'o' twice, 'n' twice and 'm' twice. I don't know if you intended this or not.
Yea, that's the way I coded it, Chris. If it revealed all the letters, it'd be too much like wheel of fortune (or whatever that game is called). 1 guess, 1 letter. ;)

.... and thanks. It's not much, just a little something to goof around with.
Post Reply