Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,823 members, 7,824,439 topics. Date: Saturday, 11 May 2024 at 10:18 AM

Acey Deucey Python And Just Basic Code - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Acey Deucey Python And Just Basic Code (1336 Views)

I Seriously Want To Learn CSS, HTML, Python And Javascript / If You Are To Advice Between Python And Java, Which Would You Pick? / Making A Bot In Python And Django (2) (3) (4)

(1) (Reply) (Go Down)

Acey Deucey Python And Just Basic Code by ABCthingx: 1:21pm On Dec 11, 2019
Here is the code in Just Basic:

' THIS IS A COMMENT IN JUST BASIC

print tab(20); "ABCTHINGX: ACEY DEUCEY CARD GAME"
print
print tab(15); "credits"
print tab(15); "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY."
print
print
print
print "ACEY-DUCEY IS A GAME PLAYED IN THE FOLLOWING MANNER"
print "THE DEALER (COMPUTER) DEALS TWO CARD FACE UP"
print "YOU HAVE AN OPTION TO BET OR NOT BET DEPENDING"
print "ON WHETHER OR NOT YOU THINK THE CARD WILL HAVE"
print "A VALUE BETWEEN THE FIRST TWO."
print
print "IF YOU DON'T WANT TO BET INPUT A 0"
N = 100
[one10] Q = 100

[one20]
print "YOU NOW HAVE " ; Q ; " NAIRA"
print

goto [two60]
[two10]
Q = Q + N
goto [one20]
[two40]
Q = Q - N
goto [one20]

[two60]
print "HERE ARE YOUR NEXT TWO CARDS"

[two70]
A = INT(14*RND(1))+2 'abcthings: i don't think A is expected to give us anything less than 2 or greather than 14
if A < 2 then [two70]
if A > 14 then [two70]

'print A; " " ; Q

[three00]
B = INT(14*RND(1))+2

if B < 2 then [three00]
if B > 14 then [three00]

if A >= B then [two70]
if A < 11 then [four00]
if A = 11 then [four20] 'i.e 11 = jack, 12 = queen 13 = king, 14 = ace
if A = 12 then [four40]
if A = 13 then [four60]
if A = 14 then [four80]

[four00]
print A
goto [five00]
[four20]print "JACK"
goto [five00]
[four40]print "QUEEN"
goto [five00]
[four60]print "KING"
goto [five00]
[four80]print "ACE"
[five00]
if B < 11 then [five50]
if B = 11 then [five70] 'i.e 11 = jack, 12 = queen 13 = king, 14 = ace
if B = 12 then [five90]
if B = 13 then [six10]
if B = 14 then [six30]

[five50]
print B
goto [six50]
[five70]print "JACK"
goto [six50]
[five90]print "QUEEN"
goto [six50]
[six10]print "KING"
goto [six50]
[six30]print "ACE"
print
[six50]
print
input "WHAT IS YOUR BET?" ; M
if M <> 0 then [six80]
print "CHICKEN!!"
print
goto [two60]
[six80]
if M <= Q then [seven30]
print "SORRY, MY FRIEND BUT YOU BET TOO MUCH"
print "YOU HAVE ONLY " ; Q ; " NAIRA TO BET"
goto [six50]
[seven30]
C = INT(14*RND(1))+2
if C < 2 then [seven30]
if C > 14 then [seven30]
if C < 11 then [eight10]
if C = 11 then [eight30]
if C = 12 then [eight50]
if C = 13 then [eight70]
if C = 14 then [eight90]

[eight10]
print C
goto [nine10]
[eight30]
print "JACK"
goto [nine10]
[eight50]
print "QUEEN"
goto [nine10]
[eight70]
print "KING"
goto [nine10]
[eight90]
print "ACE"
print
[nine10]
if C > A then [nine30]
goto [nine70]
[nine30] if C >= B then [nine70]
print "YOU WIN"
goto [two10]

[nine70]
print "SORRY YOU LOSE"
if M < Q then [two40]
print
print
print " SORRY, FRIEND BUT YOU BLEW YOUR WAD"
input "TRY AGAIN (YES OR NO)" ; A$
if A$ = "YES" then [one10]
end
Re: Acey Deucey Python And Just Basic Code by ABCthingx: 12:09pm On Dec 14, 2019
It was too buggy and too long so I had too recode it in python.
I don't know why Javanians and Pythonians hate the "Goto" keyword is I had to find a way about it.
Re: Acey Deucey Python And Just Basic Code by ABCthingx: 12:10pm On Dec 14, 2019
#ACEY DUCEY CARD GAME
#COMMENT FOR LATER: TO SHO IN GOOGLE USE ACEY DEUCEY TITLE
import random

print("ACEY DUCEY CARD GAME"wink
print("TWO CARDS ARE PLACED BEFORE YOU AND YOU BET WHETHER THE THRID CARD WILL BE IN RANGE OR NOT"wink
print("YOUR BET MUST NOT MATCH THE THRID"wink
print("for newbies jack = 11, queen = 12, king = 13 and ace = 14"wink


D = 500 #money
while (D > 100):
def getCard(): #card
x = random.randint(2, 14)
return(x)

A = getCard()#first card
B = getCard()#second card
while (A > B):
A = getCard()#first card
B = getCard()#second card
def fun(x): #function is to convert no to string when printed
if (x == 11):
x = "JACK"
if (x == 12):
x = "QUEEN"
if (x == 13):
x = "KING"
if (x == 14):
x = "ACE"
return(x)
def match(x):
if (A <= x <= B):
x = "true"
else:
x = "false"
# print(x)
return (x)


C = getCard()#third card


#for i in range(3):

print (" YOU HAVE " + str(D) + " NAIRA"wink
print (fun(A))
print (fun(B))
# print (C)
E = int(input("YOUR GUESS: "wink)
print ("CARD; " + str(C))

if (E != C ):
if (match(C) == match(E)):
print ("YOU WIN"wink
D = D + 100

else:
print ("YOU LOSE"wink
D = D - 100
else:
print ("GOTCHA! -200"wink
D = D - 200

print("YOU'RE' NOW PENNYLESS"wink
print ("Game Out"wink
Re: Acey Deucey Python And Just Basic Code by ABCthingx: 12:14pm On Dec 14, 2019
Don't be fool those icons aren't winking at you.They are semi-colons and brackets. I don't know why some thing clearly marked as code will have similes? sad
Re: Acey Deucey Python And Just Basic Code by ABCthingx: 12:18pm On Dec 14, 2019
For those that are too lazy to copy I got you covered but you have to login in to download it.

Re: Acey Deucey Python And Just Basic Code by ABCthingx: 11:11pm On Dec 14, 2019
[font=system] Testing the System font[/system]
Re: Acey Deucey Python And Just Basic Code by ABCthingx: 11:11pm On Dec 14, 2019
Testing the System font

(1) (Reply)

Web/App Developer In 2 Months. Hit 2021 Running... / Upwork Identify Verification / C#

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 21
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.