Recent Forum Posts
From categories:
page 1123...next »
Re: I am still alive
Anonymous (85.157.48.167) 1208031789|%e %b %Y, %H:%M %Z|agohover
in discussion General board. / Coffee table. » I am still alive

Hi rdc.
You cant even imagine how damn much i have wondered where the hell you are.
Good to know youre still kicking :)

Your projects sounds darn interesting (as usual), specially that book is something i would love to read. Game sounds HUGE. I want to know more details, and now i got to wait a whole month here?

Anyway, hopefully we get you back soon.

E.K.Virtanen

Re: I am still alive by Anonymous (85.157.48.167), 1208031789|%e %b %Y, %H:%M %Z|agohover
I am still alive
rickclark58rickclark58 1207948438|%e %b %Y, %H:%M %Z|agohover
in discussion General board. / Coffee table. » I am still alive

Hey Guys,

Just a little note to let you know I am still kicking. I will, hopefully, have my own connection next month some time. I have had a hard time finding an ISP that I could afford down here in Austin.

Even though I haven't been online, I have been working on a few things. I have an ascii (of course) space trading game in the works. Over 500 computer generated star systems to explore, numerous alien races, full economics model including banking and stock market, trade legally or smuggle or both, tactical combat system, create a space corporation or remain small and mobile, with open-ended game play. The object is to gain a least a billion credits but you play the game as long as you like.

I am also kicking around the idea of a book on rogue-like development using ascii. There might be a small market for that type of book since people are still interested in RL development. We'll see how that goes.

I hope everyone is well. See you all soon.

Rick

I am still alive by rickclark58rickclark58, 1207948438|%e %b %Y, %H:%M %Z|agohover

It was expanded today significantly from 30 pieces to a whopping 100 pieces. Enjoy!

Re: ASCII Nudes Collection by Anonymous (67.181.163.118), 1207603885|%e %b %Y, %H:%M %Z|agohover

Hi peoples.

We are not dead, actually we are planning to release next issue of PCopy! e-zine (issue #70) at the end of this month.
All contributions are welcomed, as usual :) We cant do this with out you folks.

MystikShadows is a editor in chief for this issue, but e-zine is the same as allways.

PCopy! website is at http://pcopy.wikidot.com/ and you can contribute articles, editorials, letters, comics, reviews, previews, news and everything to moc.liamg|ffats.ypocp#moc.liamg|ffats.ypocp

Alternative emails;
moc.liamg|dlrowiicsa#moc.liamg|dlrowiicsa
moc.liamg|swodahskitsym#moc.liamg|swodahskitsym

E.K.Virtanen, da Mystiks little helper.

Re: PCOPY! #70 Submission Deadline by Anonymous (85.157.48.167), 1207581248|%e %b %Y, %H:%M %Z|agohover
3 years full.
EKVirtanenEKVirtanen 1205338924|%e %b %Y, %H:%M %Z|agohover
in discussion ASCII-World News / Latest news. » 3 years full.

ASCII-World had it's 3'rd anniversary at March 5'th. 1094 days line was passed then. Currently age of ASCII-World in days is over 1100. Precise number today is 1101.

I am glad now after looking around programming websites around the web. Resources of computers does get better all the time and learning to make 2D and 3D graphics gets easier in same speed.
Still, new ASCII applications does pop-up nearly every week.

How come this is possible? Why newbies does still start with ASCII when simple 2D is easy to do after few weeks of learning?

I have allways thought that ASCII game is like a book. Book cant beat the movie? Maybe because it does leave visual part of the fun for reader? In same way, i think ASCII games does work.
Game is the story and the action, but visual side comes from your own imagination. There is no way 3D can beat that?

E.K.Virtanen

3 years full. by EKVirtanenEKVirtanen, 1205338924|%e %b %Y, %H:%M %Z|agohover
Domain is back.
EKVirtanenEKVirtanen 1205323411|%e %b %Y, %H:%M %Z|agohover
in discussion ASCII-World News / Latest news. » Domain is back.

Time goes fast. I did pay bills for our domain ascii-world.com two days too late. This why, it did took nearly a week until we got it back to work.
At any point, there were no danger for loosing it to some other person.

E.K.Virtanen

Domain is back. by EKVirtanenEKVirtanen, 1205323411|%e %b %Y, %H:%M %Z|agohover

The new deadline is set for March 24th and the release planned during the week after.

There's still time, but there's no point waiting for the last day ;-). So get cracking folks (your knuckles that is) and start writing up the goods. The earlier the better.

I have one contribution and planning on a few more. at least.

PCOPY! #70 Submission Deadline by MystikShadowsMystikShadows, 1203550411|%e %b %Y, %H:%M %Z|agohover
PCopy! #60 is released.
EKVirtanenEKVirtanen 1199866133|%e %b %Y, %H:%M %Z|agohover
in discussion General board. / Coffee table. » PCopy! #60 is released.

Issue #60 is out.
HTML and .zip.

PCopy! #60 is released. by EKVirtanenEKVirtanen, 1199866133|%e %b %Y, %H:%M %Z|agohover

There is still one major article badly under work and interview is 70% finished.
Fact is i cant make this happen before christmas.
I have work everyday until saturday, when i do wake up at 03:45am since i got to be at work like 5am.
Right after i get back home, we need to drive to my hometown, bit over 250km.

Since situation is this, i can only move deadline at 2'nd of January 2008. This is only way to make sure there is enough time to do and build next issue so its not bug hell.

Sorry.

E.K.Virtanen

Re: PCopy! #60 deadline is closing. by Anonymous (85.157.185.254), 1198084616|%e %b %Y, %H:%M %Z|agohover

All files, images and related what are hosted at http://www.shnetworks2.net has now moved to http://www.shnetworks4.net.
I have tried to change correct url everywhere but there is slight chance that i forgot something.

In that case, just change "2" to "4" in url and you should be ok to go.
Ill try to check everything in this day.

E.K.Virtanen

Important notice about our file host. by EKVirtanenEKVirtanen, 1197280337|%e %b %Y, %H:%M %Z|agohover

I have just added three new links at Pascal Related Links.
All are links to tutorials which i think are really good ones.

E.K.Virtanen

More Pascal related links. by EKVirtanenEKVirtanen, 1197210439|%e %b %Y, %H:%M %Z|agohover

Hi peoples.

Just reminding you that deadline for next PCopy issue is in 10 days.
To see more, check http://pcopy.wikidot.com
About PCopy! in last issue in last published issue.

All contributions at moc.liamg|ffats.ypocp#moc.liamg|ffats.ypocp
Alternative emails at http://pcopy.wikidot.com/contact

Thank you. We could not do this with out you :)

E.K.Virtanen

Re: PCopy! #60 deadline is closing. by Anonymous (85.157.185.254), 1196885740|%e %b %Y, %H:%M %Z|agohover
''' TinyBASIC, by Nicholas Christopoulos
'' A SmallBASIC example :)

DIM variables(26) '' variables (one for each letter)
DIM stack(10) '' executor''s stack (GOSUB/FOR-NEXT/WHILE-WEND)
DIM labels(), program()

DEF varidx(name) = asc(left(name))-65

ip = -1 '' next command to execute (-1 = none, -2 = error)
sp = 0 '' stack pointer

CLS
print cat(2);"TinyBASIC v1";cat(-2)
print "A 450-line (with expression parser) SmallBASIC example"
print
print "Type HELP for catalog."
print "Type QUIT to exit..."
print
print "READY"
print

repeat
input "> ", inpstr
inpstr = trim(upper(inpstr))
cmd = trim(leftof(inpstr+" ", " ")) '' get command name
if len(cmd)
par = trim(rightof(inpstr, " "))
if isnumber(cmd) '' store command
addcmd val(cmd), par
else '' execute command
execute cmd, par
fi
fi
until cmd="QUIT"
end

'' Store command to memory
sub addcmd(num, cmd)
local i, ins, rep

ins = len(labels): rep = -1
for i = 0 to len(labels)-1
if labels(i) = num then rep=i:exit
if labels(i) > num then ins=i:exit
next
if rep = -1 '' new record
if len(cmd) '' no error, insert (or append)
insert labels, ins, num
insert program, ins, cmd
fi
else
if len(cmd) '' replace
program(rep) = cmd
else '' erase
delete labels, rep
delete program, rep
fi
fi
end

'' set value to a variable
sub setvar(varname, varval)
local idx

if len(varname)>1
TBError "ILLEGAL VARIABLES NAME, USE ONE-CHAR NAMES"
else
idx = varidx(varname)
varval = trim(varval)
if left(varvar) = chr(34) '' it is a string
variables(idx) = disclose(varval)
else '' it is an expression
variables(idx) = tbeval(varval)
fi
fi
end

'' execute a TB command
sub execute(cmd, par)
local idx, i, var, vstr
local parA, tstr, fstr, f, num

if cmd in ["END", "NEW"]
'' new program or end of program; syntax: NEW or END
ip = -1
sp = 0
if cmd="NEW"
erase labels, commands '' clear program
dim variables(26) '' clear variables
print:print "* DONE *":print
fi
elif cmd in ["QUIT", "REM"]
'' do nothing
elif cmd="LET"
'' assigns a value to a variable; syntax: LET variable = expression
sinput par; var, "=", vstr
setvar var, vstr
elif cmd="LIST"
'' prints the program, syntax: LIST
if len(labels)
for i=0 to len(labels)-1
print using "####: &"; labels(i); program(i)
next
else
TBError "NO PROGRAM IN MEMORY"
fi
elif cmd="RUN"
'' run the program, syntax: RUN
ip = 0
while ip<len(labels)
last_ip = ip

cmd = trim(leftof(program(ip)+" ", " "))
par = trim(rightof(program(ip), " "))
execute cmd, par

if ip = -2
print "* ERROR AT ";labels(last_ip);" *"
sp = 0
exit
elif ip = -1
print:print "* DONE *":print
sp = 0
exit
else
ip = ip + 1
fi
wend
elif cmd="INPUT"
'' get a value form console, syntax: INPUT [prompt,] variable
split par, ",", para, chr(34)+chr(34) use trim(x)
if len(para) = 0
ip = -2
else
if len(para) = 2
idx = 1
input disclose(para(i)); vstr
else
idx = 0
input "? ", vstr
fi
setvar para(idx), vstr
fi
elif cmd="PRINT"
'' print to console, syntax: PRINT [var1 [, varN]]
split par, ",", para, chr(34)+chr(34)+"()" use trim(x)
for vstr in para
if left(vstr)=chr(34) '' print string
print disclose(vstr); " ";
else '' print number (expression)
print tbeval(vstr); " ";
fi
next
print
elif cmd in ["GOTO", "GOSUB"]
'' Syntax: GOTO line or GOSUB line
search labels, val(par), idx
if idx = -1
TBError "LABEL "+par+" DOES NOT EXIST"
else
if cmd="GOSUB"
stack(sp) = ["R", ip] '' "R" = a ''return'' command  must read it
sp = sp + 1
fi
ip = idx-1
fi
elif cmd="RETURN"
'' syntax: RETURN
if sp > 0
sp = sp - 1
if stack(sp)(0) = "R" '' later you can add code for FOR and WHILE
ip = stack(sp)(1)
else
TBError "STACK MESS"
fi
else
TBError "STACK UNDERFLOW"
fi
elif cmd="IF"
'' IF! what else?. Syntax: IF expression THEN line [ ELSE line ]
sinput par; vstr, " THEN ", tstr, " ELSE ", fstr
if tbeval(vstr)
execute "GOTO",tstr
elif len(fstr)
execute "GOTO",fstr
fi
elif cmd="SAVE"
f=disclose(par)
if len(f)=0
TBError "MISSING: FILENAME"
else
if isarray(labels)
if instr(f, ".TBAS")=0 THEN f=f+".tbas" ELSE f=leftoflast(f, ".TBAS")+".tbas"
open f for output as #1
for i=0 to len(labels)-1
print #1; labels(i); " "; program(i)
next
close #1
print:print "* DONE *":print
else
TBError "NO PROGRAM IN MEMORY"
fi
fi
elif cmd="LOAD"
f=disclose(par)
if len(f)=0
TBError "MISSING: FILENAME"
else
ip = -1
sp = 0
erase labels, commands '' clear program
dim variables(26) '' clear variables
if instr(f, ".TBAS")=0 THEN f=f+".tbas" ELSE f=leftoflast(f, ".TBAS")+".tbas"
open f for input as #1
while not eof(1)
line input #1; vstr
num  = leftof (vstr, " ")
par  = rightof(vstr, " ")
addcmd val(num), par
wend
close #1
print:print "* DONE *":print
fi
elif cmd="FILES"
print files("*.tbas")
elif cmd="HELP"
PRINT
print "  ";cat(2);"TinyBASIC, v1";cat(-2)
PRINT
print "  * All variables are real numbers."
print "  * There are 26 variables, one for each letter"
print "  * INPUT return real number (not string)"
print "  * IF-THEN accepts only line-numbers (IF x THEN line ELSE line)"
print "  * PRINT uses only , as separator"
PRINT
print "  HELP";tab(15);"This screen"
print "  NEW";tab(15);"New program"
print "  RUN";tab(15);"Run program"
print "  LIST";tab(15);"Prints program to screen"
print "  SAVE";tab(15);"Saves program to disk"
print "  LOAD";tab(15);"Loads a program from disk"
print "  FILES";tab(15);"Prints the list of TB programs"
print "  REM";tab(15);"Remarks"
print "  GOTO";tab(15);"Transfers control to ..."
print "  LET";tab(15);"Assigns a value to a variable"
print "  PRINT";tab(15);"Prints an expression"
print "  INPUT";tab(15);"Inputs a value"
print "  IF";tab(15);" "
print "  GOSUB";tab(15);" "
print "  RETURN";tab(15);" "
print "  END";tab(15);"Terminate the program"
PRINT
else
TBError "BAD COMMAND"
fi
end

'' Run-time error
sub TBError(errmsg)
PRINT
print chr(7);"* ";errmsg;" *"
PRINT
ip = -2
end

'' ==== expression parser ====

'' evaluate an expression
def TBEval(expr)
local result, rmn, c

result = 0
expr = ltrim(expr)
if len(expr) then logical result, expr
TBEval = result
end

'' number
def valueof(byref expr)
local c, i, v

for i=1 to len(expr)
c = mid(expr, i, 1)
if not (c in "0123456789.") then exit
next
if i < len(expr)
v = left(expr, i-1)
expr = mid(expr, i)
else
v = expr
expr = ""
fi
valueof = val(v)
end

'' operators: ( ) or value
sub parenth(byref l, byref expr)
local op, vname

op = left(expr)
if op = "("
expr = mid(expr, 2)
logical l, expr
if left(expr)=")" then expr = mid(expr, 2)
else
if op in "0123456789."
l = valueof(expr)
'' elif, check for function
else '' variable
l = variables(varidx(expr))
expr = if(len(expr)>1, mid(expr, 2), "")
fi
fi
end

'' unary operators: - + NOT
sub unary(byref l, byref expr)
local op

if left(expr,3) = "NOT"
op="NOT"
expr = mid(expr,4)
elif left(expr,1) in ["-", "+"]
op=left(expr)
expr=mid(expr,2)
fi
parenth l, expr
if op="NOT"
l = NOT l
elif op="-"
l = -l
elif op="+"
'' ignore it
fi
end

'' operators: * /
sub muldiv(byref l, byref expr)
local op, r

unary l, expr
while left(expr) in "*/"
op = left(expr)
expr = mid(expr, 2)
unary r, expr
if op = "*"
l *= r
elif op = "/"
if r=0
TBError "DIVISION BY ZERO"
else
l /= r
fi
fi
wend
end

'' operators: + -
sub addsub(byref l, byref expr)
local op, r

muldiv l, expr
while left(expr) in "+-"
op = left(expr)
expr = mid(expr, 2)
muldiv r, expr
if op = "+"
l += r
elif op = "-"
l -= r
fi
wend
end

'' returns the logical operator
func getlogopr(expr)
local idx, op3, op2, op1

op3=["AND"]
op2=["OR", "<=", ">=", "=<", "=>", "<>"]
op1=["=", ">", "<"]
search op3, left(expr,3), idx
if idx >= 0 then getlogopr=op3(idx):exit
search op2, left(expr,2), idx
if idx >= 0 then getlogopr=op2(idx):exit
search op1, left(expr,1), idx
if idx >= 0 then getlogopr=op1(idx):exit
getlogopr=""
end

'' logical and comparation operators
sub logical(byref l, byref expr)
local op, r

addsub l, expr
while getlogopr(expr) <> ""
op = getlogopr(expr)
expr = mid(expr, len(op)+1)
addsub r, expr
if op = "AND"
l = l AND r
elif op = "OR"
l = l OR r
elif op = "="
l = (l = r)
elif op = "<"
l = l < r
elif op = ">"
l = l > r
elif op = ">=" or op = "=>"
l = l >= r
elif op = "<=" or op = "=<"
l = l <= r
elif op = "<>"
l = l <> r
fi
wend
end
'

http://smallbasic.sourceforge.net/?q=node/139

tinyBasic with smallBasic by Anonymous (85.157.185.254), 1196740579|%e %b %Y, %H:%M %Z|agohover

Deadline is 15'th Dec. 2007.
Submissions at moc.liamg|ffats.ypocp#moc.liamg|ffats.ypocp

PCopy! #60 deadline is closing. by EKVirtanenEKVirtanen, 1196625965|%e %b %Y, %H:%M %Z|agohover

errr…have fun i guess :D

// WAR Card Game for yaBasic
// E.K.Virtanen 2007
// www.ascii-world.com
// Public Domain

// ==================================== Main loop of game
CanExit = FALSE
while(CanExit = FALSE)
    clear screen
    print ""
    print color("red") " --- War ---"
    print ""
    print " Card game for yaBasic."
    print " E.K.Virtanen, www.ascii-world.com"
    print " Public Domain"
    print ""
    print color("yellow") " 1.)"; : print " Play"
    print color("yellow") " 2.)"; : print " Help"
    print color("yellow") " 3.)"; : print " Quit"
    temp$ = inkey$
    if temp$ = "1" gosub play
    if temp$ = "2" gosub help
    if temp$ = "3" CanExit = TRUE
wend

print ""
print " Thank you for playing."
end

// ==================================== Play sub
label play
    gosub createDeck    // we need to create deck with what we play
    gosub shuffleDeck    // and then we shuffle it
    gosub playGame        // now we play
return

// ==================================== createDeck sub
label createDeck
    dim cardColor$(4, 2)
        cardColor$(1, 1) = "red" : cardColor$(1, 2) = "Heart" : cardColor$(2, 1) = "red" : cardColor$(2, 2) = "Diamond"
        cardColor$(3, 1) = "white" : cardColor$(3, 2) = "Spade" : cardColor$(4,1) =  "white" : cardColor$(4,2) = "Cross"

    // some nifty looping and MOD to get a deck of cards
    dim cardDeck(52, 2)
    for counter = 0 to 51
        cardDeck(counter + 1, 1) = int(counter / 4 + 1)
        cardDeck(counter + 1, 2) = Mod(counter, 4) + 1
    next counter
return

// ==================================== shuffleDeck sub
label shuffleDeck
    dim temp(2)
    for counter = 1 TO 10000        // ten thousand rounds should be more than enough :D
        tempFirst = int(ran(52) + 1)
        tempSecond = int(ran(52) + 1)
            if tempFirst <> tempSecond then
                temp(1) = cardDeck(tempFirst, 1)
                temp(2) = cardDeck(tempFirst, 2)
                cardDeck(tempFirst, 1) = cardDeck(tempSecond, 1)
                cardDeck(tempFirst, 2) = cardDeck(tempSecond, 2)
                cardDeck(tempSecond, 1) = temp(1)
                cardDeck(tempSecond, 2) = temp(2)
            end if
    next counter
return

// ==================================== playGame sub
label playGame
    canExit = false
    roundNumber = 0
    cardNumber = 1
    plrTotal = 0
    cpuTotal = 0

    clear screen    
    print ""
    print color("red") " --- War ---"
    print ""
    print " You can start."

    while(canExit = false)
        print " Choose, do you want first or second card?"
        print color("yellow") " 1.)"; : print " First"
        print color("yellow") " 2.)"; : print " Second"
        print " Any other key for Cpu choose."
        choice$ = inkey$

        print ""
        if(choice$ <> "1" and choice$ <> "2") gosub cpuChoose

        if choice$ = "1" then
            print " You take first."
            plrCard = cardNumber
            cpuCard = cardNumber + 1
        end if

        if choice$ = "2" then
            print " Cpu takes first."
            plrCard = cardNumber + 1
            cpuCard = cardNumber
        end if

        cardNumber = cardNumber + 2
        roundNumber = roundNumber + 1
        if cardNumber = 53 canExit = true

        gosub revealCards
        gosub whoWin
        clear screen
    wend
    print ""
    print " War is over and results are:"
    print color("yellow") " You: "; : print plrTotal; : print " cards."
    print color("red") " Cpu: "; : print cpuTotal; : print " cards."
    print ""
    print " Press any key for back to menu."
    inkey$
return

// ==================================== whoWin sub
label whoWin
    if cardDeck(plrCard, 1) > cardDeck(cpuCard, 1) then
        print ""
        print color("green") " You win!"
        print " You got both cards. ";
        plrTotal = plrTotal + 2
        if cardDeck(plrCard, 1) - cardDeck(cpuCard, 1) > 8 print " You really did crash Cpu!"
        if cardDeck(plrCard, 1) - cardDeck(cpuCard, 1) < 3 print " So tight!"
    end if

    if cardDeck(plrCard, 1) < cardDeck(cpuCard, 1) then
        print ""
        print color("red") " You lose!"
        print " Cpu got both cards.";
        if cardDeck(cpuCard, 1) - cardDeck(plrCard, 1) > 8 print " Cpu really did override you!"
        if cardDeck(cpuCard, 1) - cardDeck(plrCard, 1) < 3 print " Close, so close!"

        cpuTotal = cpuTotal + 2
    end if

    if cardDeck(plrCard, 1) = cardDeck(cpuCard, 1) then
        print ""
        print color("yellow") " It's a tie."
        print " Both got their own card."
        cpuTotal = cpuTotal + 1 : plrTotal = plrTotal + 1
    end if

    print ""
    print color("yellow") " Winned cards after round: "; : print roundNumber
    print ""
    print " You: "; : print plrTotal
    print " Cpu: "; : print cpuTotal
    gosub uselessComments
    print ""
    print color("yellow") " Press a key for next round."
    inkey$
return

// ==================================== uselessComments sub
label uselessComments
    if plrTotal > cpuTotal then
        temp$ = " You are leading here!!!"
        if plrTotal - cpuTotal > 5 temp$ = " Making a good lead there."
        if plrTotal - cpuTotal > 10 temp$ = " You trying to escape?"
        if plrTotal - cpuTotal > 15 temp$ = " HEHE, youre really crushing Cpu here!!!"
    end if
    if plrTotal < cpuTotal then
        temp$ = " You are loosing!!!"
        if cpuTotal - plrTotal > 5 temp$ = " Cpu leads clearly!"
        if cpuTotal - plrTotal > 10 temp$ = " Cpu is trying to escape?"
        if cpuTotal - plrTotal > 15 temp$ = " LOL, Cpu really kicks your ass here."
    end if
    if plrTotal = cpuTotal temp$ = " Side by side!"
    print temp$
return

// ==================================== revealCards sub
label revealCards
    print ""
    print " Your card is...";
    print  color(cardColor$(cardDeck(plrCard, 2), 1)) cardColor$(cardDeck(plrCard, 2), 2); : print " "; : print cardDeck(plrCard, 1)
    print " ...and Cpu slowly reveales hes card what is.";
    for counter = 1 to 2
        sleep 1
        print ".";
    next counter
    print  color(cardColor$(cardDeck(cpuCard, 2), 1)) cardColor$(cardDeck(cpuCard, 2), 2); : print " "; : print cardDeck(cpuCard, 1)
    print ""
return

// ==================================== cpuChoose sub
label cpuChoose
    choice$ = "1"
    if ran() = true choice$ = "2"
return

// ==================================== help sub
label help
    clear screen
    print ""
    print color("red") " --- War ---"
    print ""
    print " Card game for yaBasic."
    print " E.K.Virtanen, www.ascii-world.com"
    print " Public Domain"
    print ""
    print " I game of War, a normal card deck is shuffled."
    print " Then from a top of deck, both players gets an card."
    print " Who's card is higher (in numerical value) wins and he get's the cards."
    print " This way, whole deck is revealed to the end. Who has more cards is the winner."
    print ""
    print " You opponent is Cpu (computer) so this is one player game."
    print ""
    print color("yellow") " Press any key to return for menu."
    inkey$
return

E.K.Virtanen

War card game for yaBasic. by Anonymous (85.157.185.254), 1195764856|%e %b %Y, %H:%M %Z|agohover
Back to basic; Dice game
EKVirtanenEKVirtanen 1195651857|%e %b %Y, %H:%M %Z|agohover
in discussion ASCII board. / ASCII programming. » Back to basic; Dice game
// Dice game for yaBasic www.yabasic.de
// Just having a fun here. Nothing special

diceMax = 6        // max value of dice
diceMin = 1        // min value of dice
CanExit = false

// MAIN GAME LOOP
while(CanExit = false)
    clear screen
    print ""
    print "  Dice Game for yaBasic!"
    print " ************************"
    print ""
    print " Just having fun, nothing special here."
    print " E.K.Virtanen www.ascii-world.com"
    print " Public Domain"
    print ""
    print " Select:"
    print " 1.) Play"
    print " 2.) Help"
    print " 3.) Quit"
    temp$ = inkey$
        if(temp$ = "1") gosub play
        if(temp$ = "2") gosub help
        if(temp$ = "3") CanExit = true
wend
clear screen
print ""
print " Thank you for playing."
end

label play
    gosub plrPlay
    if plrTotal < 22 gosub cpuPlay
return

label plrPlay
    plrTotal = 0
    throwNum = 0
    done = false

    while(done = false)
        throwNum = (throwNum + 1)
        clear screen
        print ""
        print " This is throw #", throwNum
        print " Press a key to throw a dice"
        print ""
        inkey$

        diceVal = int(ran(diceMax) + diceMin)
        plrTotal = (plrTotal + diceVal)
        sleep 1

        print " You did throw ", diceVal
        // Now we check few things.
        if(plrTotal > 21) then
            print " You go over 21. You lost."
            done = true
        end if

        if(plrTotal = 21) then
            print " You got it. 21 excatly."
            done = true
            break
        end if

        print " Your total is ", plrTotal
        print " Press 's' to stay or any other key for more."
        if(inkey$ = "s") done = true
    wend
return

label cpuPlay
    cpuTotal = 0
    throwNum = 0
    done = false

    while(done = false)
        throwNum = (throwNum + 1)
        clear screen
        print ""
        print " This is my throw #", throwNum
        print ""
        sleep 1

        diceVal = int(ran(diceMax) + diceMin)
        cpuTotal = (cpuTotal + diceVal)

        print " I did throw ", diceVal
        // Now we check few things.
        if(cpuTotal > 21) then
            print " I did go over 21. I lost."
            break
        end if

        if(cpuTotal = 21) then 
            if(plrTotal < 21) print " You lost, i got 21."
            if(plrTotal = 21) print" Amazing, we both got 21. You lost since it's tie."
            break
        end if

        if(cpuTotal = plrTotal) then
            print " I have same result now, in tie so i win."
            break
        end if

        print " My total is ", cpuTotal
        print " Your total was ", plrTotal
        print ""
        if(plrTotal > cpuTotal) print " I just got to throw more to beat you."
        if(plrTotal < cpuTotal) then 
            print " No need to throw more, i did beat you"
            done = true
        end if
        sleep 3
    wend
    inkey$
return

label help
    clear screen
    print ""
    print "  Dice Game for yaBasic!"
    print " ************************"
    print ""
    print " In this game, you throw a single six sided dice."
    print " Result of your throw is counted after every round."
    print " Idea is to get as close of total 21 as possible."
    print " Basic idea is same than in BlackJack card game."
    print ""
    print " If you go over 21, you loose automaticly."
    print " After youre done, computer throws too and tries to beat you."
    print " In tie, computer wins."
    print ""
    print " Press any key to return for menu."
    inkey$
return
Back to basic; Dice game by EKVirtanenEKVirtanen, 1195651857|%e %b %Y, %H:%M %Z|agohover
Re: guess the number topic by EKVirtanenEKVirtanen, 1195649410|%e %b %Y, %H:%M %Z|agohover
Guess It pages changed.
EKVirtanenEKVirtanen 1195649329|%e %b %Y, %H:%M %Z|agohover
in discussion ASCII-World News / Latest news. » Guess It pages changed.

Pages relevant to "Guess It" project has been changed. Follow example links in pages if youre adding more exxmple games.

Guess it

Guess It pages changed. by EKVirtanenEKVirtanen, 1195649329|%e %b %Y, %H:%M %Z|agohover
Re: guess the number topic
EKVirtanenEKVirtanen 1195644597|%e %b %Y, %H:%M %Z|agohover
in discussion ASCII board. / ASCII programming. » guess the number topic

Thanks Jare for your contribution.
Finnish
Pystyisitkö muokkaamaan tuota niin että se olisi hieman enemmän samallalailla toimiva kuin muutkin sorsat?
Eli

PÄÄLOOPPI
tehdään valimistelut, printataan alkuteksti blaablaa

PELILOOPPI
kysellään kunnes oikein
//PELILOOPPI

Pääloopissa pysytään kunnen pelaaja arvaa 0 (eli haluaa lopettaa)
//PÄÄLOOPPI

Re: guess the number topic by EKVirtanenEKVirtanen, 1195644597|%e %b %Y, %H:%M %Z|agohover

Sorry, the code just didn't end up in the way I ment (no indents etc.).

Here is more better looking one: http://koti.mbnet.fi/jare1/filer/files/guess.CB

Re: guess the number topic by Anonymous (88.112.81.135), 1195593588|%e %b %Y, %H:%M %Z|agohover
page_revision: 0, last_edited: 1181740773|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.