I still need to add a split function and also I need to create a random sequence for a set of cards right now its spitting cards out at random. Should be complete soon.
Left clicking on numbers will increase bet
Right clicking on numbers will decrease bet
Global c_width
Global c_height
Global cards
Global s_money = 1000
Global received_p1
Global p1_Suite
Global ai_Suite
Global p1_Number
Global ai_Number
Global p1_blackjack
Global ai_blackjack
Global hit
Global c_out
Global c_out_ai
Global p1_total
Global ai_total
Global bet
Global p1_Bet
Global money_p1
Global money_ai
Global p1_bust
Global ai_bust
Global ai_turn
Global received_ai
Global received_p1
Dim cards(5,14)
Dim p1_Suite(20)
Dim p1_Number(20)
Dim ai_Suite(20)
Dim ai_Number(20)
c_width = 90 ` Card Width
c_height = 120 ` Card Height
c_out = 1
money_p1 = s_money
money_ai = s_money
gfx_mode()
create_bg()
c_front()
c_back()
make_cards()
do
cls
draw_hud()
if hit = 1 Then _hit()
if ai_turn = 1 then _ai()
if bet = 1 then get_cards()
draw_cards()
if p1_bust = 1 or ai_bust = 1 then _bust()
if p1_blackjack = 1 and ai_blackjack = 1 then bet = -8 ` push
if p1_total = 21 and c_out = 1
p1_blackjack = 1
_blackjack()
endif
if ai_total = 21 and c_out_ai = 1
ai_blackjack = 1
_blackjack()
endif
sync
loop
function check_win()
if ai_total > p1_total and ai_total <= 21 and bet = 1
inc money_ai,p1_Bet
dec money_p1,p1_Bet
bet = -6
endif
if p1_total > ai_total and p1_total <= 21 and bet = 1
inc money_p1,p1_Bet
dec money_ai,p1_Bet
bet = -7
endif
if ai_total = p1_total then bet = -8
endfunction
function _ai()
Rem If ai card total is lower than 17 then hit
if ai_total < 17
inc c_out_ai,1
ai_Suite(c_out_ai) = rnd(3)+1
ai_Number(c_out_ai) = rnd(12)+1
if ai_Number(c_out_ai) >= 2 and ai_Number(c_out_ai) <= 10 then inc ai_total,ai_Number(c_out_ai)
if ai_Number(c_out_ai) > 10 then inc ai_total,10
if ai_Number(c_out_ai) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 11 then inc ai_total,11
endif
if ai_total > 21 Then ai_bust = 1
endif
Rem If ai card total is 17 or greater then check who won
if ai_total >= 17 and ai_total <= 21 then check_win()
endfunction
function _blackjack()
if p1_blackjack = 1 and bet = 1
inc money_p1,p1_Bet
dec money_ai,p1_Bet
bet = -4
endif
if ai_blackjack = 1 and bet = 1
inc money_ai,p1_Bet
dec money_p1,p1_Bet
ai_turn = 1
bet = -5
endif
p1_blackjack = 0
ai_blackjack = 0
endfunction
function _bust()
if p1_bust = 1
dec money_p1,p1_Bet
inc money_ai,p1_Bet
bet = -2
endif
if ai_bust = 1
dec money_ai,p1_Bet
inc money_p1,p1_Bet
bet = -3
endif
p1_bust = 0
ai_bust = 0
endfunction
function _hit()
hit = 0
p1_Suite(c_out) = rnd(3)+1
p1_Number(c_out) = rnd(12)+1
if p1_Number(c_out) >= 2 and p1_Number(c_out) <= 10 then inc p1_total,p1_Number(c_out)
if p1_Number(c_out) > 10 then inc p1_total,10
if p1_Number(c_out) = 1
if p1_total > 11 then inc p1_total,1
if p1_total <= 11 then inc p1_total,11
endif
if p1_total > 21 Then p1_bust = 1
while mouseclick() = 1
endwhile
endfunction
function draw_cards()
if received_p1 = 1
paste image cards(p1_Suite(0),p1_Number(0)),100,500
paste image cards(p1_Suite(1),p1_Number(1)),200,500
for a = 2 to c_out ` draws all the cards out
paste image cards(p1_Suite(a),p1_Number(a)),(a+1)*100,500
next a
endif
if received_ai = 1 and ai_turn = 0
paste image img_front,100,100
paste image img_front,200,100
endif
if received_ai = 1 and ai_turn = 1
paste image cards(ai_Suite(0),ai_Number(0)),100,100
paste image cards(ai_Suite(1),ai_Number(1)),200,100
for b = 2 to c_out_ai ` draws all the cards out
paste image cards(ai_Suite(b),ai_Number(b)),(b+1)*100,100
next b
endif
endfunction
function get_cards()
if received_p1 = 0
p1_Suite(0) = rnd(3)+1 : p1_Number(0) = rnd(12)+1
p1_Suite(1) = rnd(3)+1 : p1_Number(1) = rnd(12)+1
received_p1 = 1
if p1_Number(0) >= 2 and p1_Number(0) <= 10 then inc p1_total,p1_Number(0)
if p1_Number(0) > 10 then inc p1_total,10
if p1_Number(0) = 1
if p1_total > 11 then inc p1_total,1
if p1_total <= 11 then inc p1_total,11
endif
if p1_Number(1) >= 2 and p1_Number(1) <= 10 then inc p1_total,p1_Number(1)
if p1_Number(1) > 10 then inc p1_total,10
if p1_Number(1) = 1
if p1_total > 11 then inc p1_total,1
if p1_total <= 10 then inc p1_total,11
endif
endif
if received_ai = 0
ai_Suite(0) = rnd(3)+1 : ai_Number(0) = rnd(12)+1
ai_Suite(1) = rnd(3)+1 : ai_Number(1) = rnd(12)+1
received_ai = 1
if ai_Number(0) >= 2 and ai_Number(0) <= 10 then inc ai_total,ai_Number(0)
if ai_Number(0) > 10 then inc ai_total,10
if ai_Number(0) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 10 then inc ai_total,11
endif
if ai_Number(1) >= 2 and ai_Number(1) <= 10 then inc ai_total,ai_Number(1)
if ai_Number(1) > 10 then inc ai_total,10
if ai_Number(1) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 11 then inc ai_total,11
endif
endif
endfunction
function draw_hud()
Set Text Font "Arial" : Set Text Size 19
paste image img_bg,0,0
paste image deal_off,345,screen height()-40
paste image stay_off,400,screen height()-40
paste image hit_off,450,screen height()-40
paste image dbl_off,500,screen height()-40
paste image split_off,605,screen height()-40
paste image b5_off,700,screen height()-40
paste image b10_off,740,screen height()-40
paste image b25_off,780,screen height()-40
paste image b50_off,820,screen height()-40
paste image b100_off,860,screen height()-40
paste image b500_off,900,screen height()-40
if mouseX() >= 345 and mouseX() <= 395
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 510,345,screen height()-40 ` DEAL
if mouseclick() = 1 And bet < 1
bet = 1
received_p1 = 0
received_ai = 0
c_out = 1
p1_total = 0
ai_total = 0
ai_turn = 0
c_out_ai = 1
endif
while mouseclick() = 1
endwhile
endif
endif
if mouseX() >= 400 and mouseX() <= 445
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 500,400,screen height()-40 ` STAY
if mouseclick() = 1
ai_turn = 1
endif
while mouseclick() = 1
endwhile
endif
endif
if mouseX() >= 450 and mouseX() <= 495
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 501,450,screen height()-40 ` HIT
if mouseclick() = 1 and bet = 1 and ai_turn = 0
hit = 1
inc c_out,1
endif
endif
endif
if mouseX() >= 500 and mouseX() <= 600
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 502,500,screen height()-40 ` DOUBLE DOWN
if mouseclick() = 1 and bet = 1 and ai_turn = 0
inc p1_Bet,p1_Bet
hit = 1
ai_turn = 1
inc c_out
endif
while mouseclick() = 1
endwhile
endif
endif
if mouseX() >= 605 and mouseX() <= 660
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 503,605,screen height()-40 ` SPLIT
endif
endif
if mouseX() >= 700 and mouseX() <= 735
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 504,700,screen height()-40 ` Bet 5
if mouseclick() = 1 and bet < 1
inc p1_Bet,5
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,5
while mouseclick() = 2
endwhile
endif
endif
endif
if mouseX() >= 740 and mouseX() <= 775
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 505,740,screen height()-40 ` Bet 10
if mouseclick() = 1 and bet < 1
inc p1_Bet,10
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,10
while mouseclick() = 2
endwhile
endif
endif
endif
if mouseX() >= 780 and mouseX() <= 815
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 506,780,screen height()-40 ` Bet 25
if mouseclick() = 1 and bet < 1
inc p1_Bet,25
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,25
while mouseclick() = 2
endwhile
endif
endif
endif
if mouseX() >= 820 and mouseX() <= 855
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 507,820,screen height()-40 ` Bet 50
if mouseclick() = 1 and bet < 1
inc p1_Bet,50
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,50
while mouseclick() = 2
endwhile
endif
endif
endif
if mouseX() >= 860 and mouseX() <= 895
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 508,860,screen height()-40 ` Bet 100
if mouseclick() = 1 and bet < 1
inc p1_Bet,100
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,100
while mouseclick() = 2
endwhile
endif
endif
endif
if mouseX() >= 900 and mouseX() <= 935
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image 509,900,screen height()-40 ` Bet 500
if mouseclick() = 1 and bet < 1
inc p1_Bet,500
while mouseclick() = 1
endwhile
endif
if mouseclick() = 2 and bet < 1
dec p1_Bet,500
while mouseclick() = 2
endwhile
endif
endif
endif
if received_p1 = 1
ink rgb(0,0,0),1 : box 75,500,95,520
ink rgb(255,255,255),1 : set cursor 75,500
print p1_total
endif
if received_ai = 1 and ai_turn = 1
ink rgb(0,0,0),1 : box 75,100,95,120
ink rgb(255,255,255),1 : set cursor 75,100
print ai_total
endif
set cursor 10,screen height()-40 : ink RGB(25,200,0),1
Print "YOU: $ ",money_p1," DEALER: $",money_ai
if bet = 0
Set cursor screen width()/2 - 100,10 : ink rgb(255,255,255),1
print "PLEASE PLACE YOUR BET"
endif
if bet = -2
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "YOU BUSTED! DEALER WINS! PLEASE PLACE YOUR BET"
endif
if bet = -3
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER BUSTED! YOU WIN! PLEASE PLACE YOUR BET"
endif
if bet = -4
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "YOU RECEIVED A BLACK JACK! YOU WON!"
endif
if bet = -5
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER RECEIVED A BLACK JACK! YOU LOST!"
endif
if bet = -6
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER HAS WON! YOU LOST!"
endif
if bet = -7
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "CONGRATULATIONS YOU WIN"
endif
if bet = -8
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "IT'S A PUSH! NOBODY WINS!"
endif
ink RGB(255,255,255),1
if p1_Bet < 0 then p1_Bet = 0
if p1_Bet > money_p1
p1_Bet = money_p1
ink rgb(255,100,0),1
endif
set cursor 945,screen height()-40 : Print "Bet: ",p1_Bet
endfunction
function create_bg()
set cursor screen width()/2-10,screen height()/2
ink RGB(255,255,255),1 : print "LOADING..."
wait 100
sync on
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "STAY"
Global stay_off
stay_off = free_image()
Get image stay_off,400,screen height()-41,445,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "STAY"
Global stay_on
stay_on = 500
Get image stay_on,400,screen height()-41,445,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print " HIT"
Global hit_off
hit_off = free_image()
Get image hit_off,400,screen height()-41,445,screen height()-8
cls
ink rgb(200,200,200),1
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print " HIT"
Global hit_on
hit_on = 501
Get image hit_on,400,screen height()-41,445,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,500,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,499,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "DOUBLE DOWN"
Global dbl_off
dbl_off = free_image()
Get image dbl_off,400,screen height()-41,500,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,500,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,499,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "DOUBLE DOWN"
Global dbl_on
dbl_on = 502
Get image dbl_on,400,screen height()-41,500,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "SPLIT"
Global split_off
split_off = free_image()
Get image split_off,400,screen height()-41,450,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "SPLIT"
Global stay_on
split_on = 503
Get image split_on,400,screen height()-41,450,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,0,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print " 5"
Global b5_off
b5_off = free_image()
Get image b5_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(100,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,0,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print " 5"
Global b5_on
b5_on = 504
Get image b5_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,1,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "1 0"
Global b10_off
b10_off = free_image()
Get image b10_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,0,1,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "1 0"
Global b10_on
b10_on = 505
Get image b10_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "2 5"
Global b25_off
b25_off = free_image()
Get image b25_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,0,0,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "2 5"
Global b25_on
b25_on = 506
Get image b25_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,1,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "5 0"
Global b50_off
b50_off = free_image()
Get image b50_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,1,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "5 0"
Global b50_on
b50_on = 507
Get image b50_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "100"
Global b100_off
b100_off = free_image()
Get image b100_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,0,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "100"
Global b100_on
b100_on = 508
Get image b100_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "500"
Global b500_off
b500_off = free_image()
Get image b500_off,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,10,1,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "500"
Global b500_on
b500_on = 509
Get image b500_on,400,screen height()-41,435,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "DEAL"
Global deal_off
deal_off = free_image()
Get image deal_off,400,screen height()-41,450,screen height()-8
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,25,25,25,5,1,1,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "DEAL"
Global deal_on
deal_on = 510
Get image deal_on,400,screen height()-41,450,screen height()-8
_gradient(0,0,screen width(),screen height(),0,10,0,0.05,0,1,0)
_gradient(0,0,screen width(),50,0,0,0,0.25,1,1,1)
_gradient(0,screen height()-50,screen width(),screen height(),0,0,0,0.25,1,1,1)
Global img_bg
img_bg = free_image()
get image img_bg,0,0,screen width(),screen height()
endfunction
function c_front()
ink rgb(255,255,255),1
box 0,0,screen width(),screen height()
ink rgb(0,0,0),1
box c_width,c_height,c_width*2,c_height*2
ink rgb(255,255,255),1
_gradient(c_width+1,c_height+1,c_width*2-1,c_height*2-1,225,225,200,0.25,1,1,1)
ink rgb(25,25,100),1
box c_width+5,c_height+5,c_width*2-5,c_height*2-5
ink rgb(255,255,255),1
box c_width+7,c_height+7,c_width*2-7,c_height*2-7
ink rgb(25,25,100),1
box c_width+8,c_height+8,c_width*2-8,c_height*2-8
ink rgb(255,255,255),1
box c_width+10,c_height+10,c_width*2-10,c_height*2-10
ink rgb(25,25,100),1
_gradient(c_width+11,c_height+11,c_width*2-11,c_height*2-11,25,25,100,1,0,0,1)
Global img_front
img_front = free_image()
Get Image img_front,c_width,c_height,c_width+90,c_height+120
cls
endfunction
function c_back()
ink rgb(255,255,255),1
box 0,0,screen width(),screen height()
ink rgb(0,0,0),1
box c_width,c_height,c_width*2,c_height*2
ink rgb(255,255,255),1
_gradient(c_width+1,c_height+1,c_width*2-1,c_height*2-1,225,225,200,0.25,1,1,1)
Global img_back
img_back = free_image()
Get image img_back,c_width,c_height,c_width*2,c_height*2
cls
endfunction
function make_cards()
for suite = 167 to 170
for number = 1 to 13
cls
paste image img_back,10,10
align_font(suite,number)
align_symbols(suite,number)
cards(n+1,number) = free_image()
Get Image cards(n+1,number),10,10,c_width+10,c_height+10
next b
inc n,1
next a
endfunction
function align_symbols(suite,number)
ink RGB(255,0,0),1
if suite = 167 then ink RGB(0,0,0),1
if suite = 170 then ink RGB(0,0,0),1
if number = 1 and suite = 170
set text size 125
set cursor 25,10 : print chr$(suite)
endif
if number = 1 and suite < 170
set text size 35
set cursor 47,47 : print chr$(suite)
endif
if number = 2
set text size 35
set cursor 47,15 : print chr$(suite)
set cursor 47,80 : print chr$(suite)
endif
if number = 3
set text size 35
set cursor 47,15 : print chr$(suite)
set cursor 47,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 4
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
endif
if number = 5
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 6
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
endif
if number = 7
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
endif
if number = 8
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
set cursor 47,65 : print chr$(suite)
endif
if number = 9
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 25,38 : print chr$(suite)
set cursor 25,60 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,38 : print chr$(suite)
set cursor 68,60 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 10
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 25,38 : print chr$(suite)
set cursor 25,60 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,38 : print chr$(suite)
set cursor 68,60 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
set cursor 47,65 : print chr$(suite)
endif
endfunction
function align_font(suite,number)
ink RGB(255,0,0),1
if suite = 167 then ink RGB(0,0,0),1
if suite = 170 then ink RGB(0,0,0),1
set text font "Impact"
set text size 20
` set cursor 15,12 : print number
if number >= 2 And number <= 9
set cursor 15,12
print number
endif
if number = 1
set cursor 15,12
print "A"
endif
if number = 10
set cursor 15,12
print number
endif
if number = 11
set cursor 15,12
print "J"
endif
if number = 12
set cursor 15,12
print "Q"
endif
if number = 13
set cursor 15,12
print "K"
endif
REM Lower-Right Corner
if number >= 2 And number <= 9
set cursor 87,107
print number
endif
if number = 1
set cursor 87,107
print "A"
endif
if number = 10
set cursor 83,107
print number
endif
if number = 11
set cursor 87,107
print "J"
endif
if number = 12
set cursor 87,107
print "Q"
endif
if number = 13
set cursor 87,107
print "K"
endif
set text font "symbol"
set text size 20
set cursor 14,25 : print chr$(suite)
set cursor 85,92 : print chr$(suite)
endfunction
function _gradient(X1,Y1,X2,Y2,r#,g#,b#,blend#,ri,gi,bi)
REM X1,Y1,X2,Y2 is the area which will be filled
REM r#,g#,b# are color presets that will alter the beginning gradient color
REM blend# is the amount at which the color values are incremented
REM ri,gi,bi if all set to 1 will increment corresponding #blend
for y = Y1 to Y2 - 1
ink RGB(r#,g#,b#),1
line X1,y,X2,y
if ri AND r# < 255 then inc r#,blend#
if gi AND g# < 255 then inc g#,blend#
if bi AND b# < 255 then inc b#,blend#
next y
endfunction
function free_image()
repeat
inc n,1
until image exist (n) = 0
endfunction n
function gfx_mode()
Set Display Mode 1024,768,32
set display mode 1024,768,32
Sync Rate 70
endfunction