TGC Codebase Backup



game of the gibbet! by instinto criador

19th Nov 2006 20:20
Summary

A good game of the gibbet



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    inicio:
cls


e=0
f=0
g=0
h=0
i=0
j=0
k=0
l=0
c$=""
a$=""
f$=""

dim erro$(8)
for mm=1 to 8
erro$(mm)=""
next mm

volta:
ink rgb(255,255,255),0
set cursor 0,25
input "digite uma palavra:"; ab$

xa=len(ab$)
for ya=1 to xa
if mid$(ab$,ya)=chr$(32)
a$=a$+""
else
a$=a$+mid$(ab$,ya)
endif
next ya

cls

if a$="" then goto volta
x=len(a$)
dim b$(x)
for y=1 to x
b$(y)="_ "
if mid$(a$,y)="-"
b$(y)="-"
print b$(y);" ";
else
print b$(y);
endif
next y

DO
if e<x then e=0
if f<x and f>-1 then f=0
if g<x and g>-1 then g=0
if h<x and h>-1 then h=0
if i<x and i>-1 then i=0
if j<x and j>-1 then j=0
if k<x and k>-1 then k=0
if l<x and l>-1 then l=0
set cursor 0,10
print
input "digite uma letra:"; c$

cls

FOR y=1 to x
if b$(y)=mid$(a$,y)
else
b$(y)="_ "
endif


if c$=lower$(b$(y)) or c$=upper$(b$(y))
ganhaouperde()
else
for jj=1 to 8
if (c$=lower$(erro$(jj)) or c$=upper$(erro$(jj))) and erro$(jj)<>"" then ganhaouperde()
next jj
endif


if lower$(c$)=mid$(a$,y)
b$(y)=lower$(c$)
print b$(y);" ";
else
if upper$(c$)=mid$(a$,y)
b$(y)=upper$(c$)
print b$(y);" ";
else
if b$(y)="_ "
b$(y)="_"
print b$(y);" ";
else
print b$(y);" ";
endif
endif
endif

if y>1 and b$(y)=mid$(a$,y)
f$=f$+b$(y)
else
if b$(y)=mid$(a$,y) and y=1 then f$=b$(y)
endif
if f$=a$
ink rgb(0,255,20),0
text 150,400,"VOCE VENCEU!"
goto frase
endif


if e=x
cabeca()
else
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and c$<>"" then inc e
if e=x
erro$(1)=c$
cabeca()
else
goto laco
endif
endif


if f=x
tronco()
else
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and e=x and c$<>"" and c$<>lower$(erro$(1)) and c$<>upper$(erro$(1)) then inc f
if f=x
erro$(2)=c$
tronco()
else
goto laco
endif
endif



if g=x
pernadireita()
else
kk=0
for zz=1 to 2
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and f=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=2 then inc g
if g=x
erro$(3)=c$
pernadireita()
else
goto laco
endif
endif



if h=x
pernaesquerda()
else
kk=0
for zz=1 to 3
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and g=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=3 then inc h
if h=x
erro$(4)=c$
pernaesquerda()
else
goto laco
endif
endif



if i=x
bracodireito()
else
kk=0
for zz=1 to 4
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and h=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=4 then inc i
if i=x
erro$(5)=c$
bracodireito()
else
goto laco
endif
endif



if j=x
bracoesquerdo()
else
kk=0
for zz=1 to 5
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and i=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=5 then inc j
if j=x
erro$(6)=c$
bracoesquerdo()
else
goto laco
endif
endif



if k=x
corda()
else
kk=0
for zz=1 to 6
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and j=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=6 then inc k
if k=x
erro$(7)=c$
corda()
else
goto laco
endif
endif



if l=x
madeiro()
else
kk=0
for zz=1 to 7
if c$<>lower$(mid$(a$,y)) and c$<>upper$(mid$(a$,y)) and k=x and c$<>"" and c$<>lower$(erro$(zz)) and c$<>upper$(erro$(zz)) then inc kk
next zz
if kk=7 then inc l
if l=x
erro$(8)=c$
madeiro()
else
goto laco
endif
endif


if l=x
ink rgb(255,110,0),0
text 150,430," VOCE PERDEU!"
goto frase
endif

laco:
NEXT y
c$=""
LOOP

frase:
wait key
goto inicio
end

function ganhaouperde()
text 100,400, "voce ja digitou esta letra"
text 100,415, "       tente outra!"
endfunction

function cabeca()
circle 200,200,30
endfunction

function tronco()
line 200,230,200,300
endfunction

function pernadireita()
line 200,300,250,350
endfunction

function pernaesquerda()
line 200,300,150,350
endfunction

function bracodireito()
line 200,250,250,300
endfunction

function bracoesquerdo()
line 200,250,150,300
endfunction

function corda()
line 200,170,200,150
endfunction

function madeiro()
line 170,150,230,150
endfunction