Play game
Poker Squares (1kB)'s itch.io pageCompressed Bytes used
1016
Source Code (OPTIONAL)
function _init()p={"a",2,3,4,5,6,7,8,9,10,"j","q","k"}j={"◆","³i*","♥","³iIᵇy^³c-³d-³a-"}t=true s=false o=tonum q=count a={}for e=1,4do for n=1,13do add(a,{n,e})end end d={}for e=1,25do k=a[flr(rnd(#a))+1]add(d,k)del(a,k)end r={}h={}for e=1,5do r[e]={}h[e]={}for n=1,5do r[e][n]={0,0}h[e][n]={0,0}end end
?"⁷s3i6v2c0.c#.c.f.c1.c.c.c.c#.c.a#0.c1.a#0.c1.c.c"
end function I(n,e,f,d,r)if r then rect(n,e,n+15,e+15,6)
if(f==0)return
rectfill(n,e,n+14,e+14,7)end y=n+3-o(f==10)*2
?p[f]..j[d],y,e+5,d%2*8
?p[f]..j[d],y,e+5,d%2*8
end e=2n=2function x(e)u={0,0,0,0,0,0,0,0,0,0,0,0,0}m={0,0,0,0}b=0w=s l=s c={0,0,0,0}max=0min=13for n=1,5do if e[n][1]>0then b+=1u[e[n][1]]+=1m[e[n][2]]+=1
if(e[n][1]<min)min=e[n][1]
if(e[n][1]>max)max=e[n][1]
end end v=u[1]for e=10,13do v+=o(u[e]>0)end
for e=1,4do if(m[e]>4)w=t end
for e=1,13do
if(u[e]>1)c[u[e]]+=1
end
if(max-min==4and b>4)l=t
if(c[4]>0)return 50
if c[3]>0then
if(c[2]>0)return 25
return 10end
if(c[2]>1)return 5
if(c[2]>0)return 2
if w then if v==5then return 100elseif l then return 75else return 20end end
if(l or v==5)return 15
return 0end function _update()i=btnp cls(3)for e=0,4do for n=0,4do z=r[e+1][n+1]I(16+e*20,16+n*20,z[1],z[2],t)end end if q(d)>0then
?"next card:",33,6,7
I(75,1,d[1][1],d[1][2],s)if i()>0then
if(i(0))e-=1
if(i(1))e+=1
if(i(3))n+=1
if(i(2))n-=1
if(e>4)e=0
if(e<0)e=4
if(n>4)n=0
if(n<0)n=4
if i(5)then if r[e+1][n+1][1]<1then r[e+1][n+1]=d[1]del(d,d[1])
?"⁷s5d#1g#1g#1"
else
?"⁷s6f#0e0"
end end end A=15+e*20B=15+n*20rect(A,B,A+17,B+17,1)else if flr(time())%3==1then
?"🅾️ reshuffle",40,6,7
else?"total points: "..g.."/100",26-(o(f>9)+o(f>99))*3,6,7
end end if q(d)>24then
?"⬆️⬇️⬅️⬇️move ❎place card",6,118,7
else g=0for e=1,5do f=x(r[e])g+=f
?f,2+20*e-(o(f>9)+o(f>99))*2,114,7
end for e=1,5do for n=1,5do h[e][n]=r[n][e]end end
for e=1,5do f=x(h[e])g+=f?f,114,1+20*e,7
end end
if(i(4))_init()
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
This is very well done (esp to get all this logic in 1K)
Never played Poker Squares b4, but always enjoyed video poker, etc.
Really tough concept - I managed about 66 on avg.
Wonder how much of this relies on luck vs. skill
(but guess you could say the same for any poker game!)
Nice entry! 👍
I really love this, it brings back memories of being a kid.