Yobilee’s blog



Spil programmeret i Liberty Basic

Som et lille delprodukt har jeg udviklet et lille spil i programmeringssproget Liberty BASIC, det er et lille spil der gælder om at ramme det rigtige tal.

Kildekoden er selvfølgelig frit tilgængelig, online her på siden. Programmet kan ikke køre helt standalone, så filerne i filen skal blive i mappen for at det kan køres:

Kildekoden som følger:

Print “Enter your name”;
Input Name$
Print “All right “;Name$;” choose a number between 1 and 10″

[begin]

CLS

count = 0

Number = INT(RND(0) * 10) + 1

Print “All right “;Name$;” choose a number between 1 and 10

[loop]

Print “What is your choice?”;
Input a

If a > Number then
print “Too High”
count = count + 1
goto [loop]
End if

If a < Number then
print “Too Low”
count = count + 1
goto [loop]
End if

If a = Number then
print “All right! You got it!”
End if
Print “”
print “Faults:” ;count
Print “Do you wish to play again – (y = yes, n = no)?”;
Input answer$

If answer$ = “y” then
Cls
Goto [begin]
End if

If answer$ = “n” then
print “Thanks for playing – Good bye”
print “Are you sure (y = yes, n = no)”
print “Made by: Larrrsen”;
input sure$
end if

If sure$ = “n” then
goto [begin]
End if

If sure$ = “y” then
END
End if

Kort lille program, ganske simpelt, og kan hentes frit her. Filen skal pakkes ud før den køres:




Skriv en kommentar

You must be logged in to post a comment.