0 Members and 2 Guests are viewing this topic.
Lua sounds great! I'll definitely want to see that happen. Seeing how you improved your code, let's say it sounds very familiar Especially with my current project P.S. Your list of programs in your stadium seems interesting. Is there a possibility I could have a look at the source/get all of em?
It sounds very familiar? To what?
Jason's TI-nspire Hold 'em has reached 3000 downloads!http://www.ticalc.org/archives/files/fileinfo/430/43059.htmlI shall soon be uploading a 'master' plan for my intentions of taking this game to a whole new level.
--[[TI-nspire Hold 'em - A Lua RemakeHistory:v0.01 Created 2012/09/23 really started working 2012/10/07Buggy can hardly do anything, currently can change Chips, Big Blind, Small Blind]]--function init_variables() cc=0 bb=0 sb=0 gopt=1 scrn=1endinit_variables() function on.paint(gc) gc:setFont("sansserif","r",10) gc:setColorRGB(0,0,0) -- gc:setPen("thin","smooth") Is this necessary? if scrn==1 then gc:drawString("[c] Chips " .. cc,10,10,"top") gc:drawString("[b] Big Blind " .. bb,10,25,"top") gc:drawString("[s] Small Blind " .. sb,10,40,"top") gc:drawRect(10,70,20,20) elseif scrn==2 then gc:drawString("Right let's get rolling!",10,10,"top") end endfunction on.charIn(ch) if ch >= "0" and ch <= "9" then -- checking for digit inputs if scrn==1 then if gopt==1 then if string.len(cc) <= 7 then -- limit string length cc = cc .. ch -- concatenate platform.window:invalidate() -- screen refresh end elseif gopt==2 then if string.len(bb) <= 6 then -- and sb <= 0.1bb then -- limit string length and bb to <= 0.1cc (now moved) bb = bb .. ch -- concatenate platform.window:invalidate() -- screen refresh end elseif gopt==3 then if string.len(sb) <= 6 then -- and sb <= 0.1bb then -- limit string length and sb to <= 0.1bb (now moved) sb = sb .. ch -- concatenate platform.window:invalidate() -- screen refresh end end end end--Game settings keys if scrn==1 then if ch=="c" then --Ok there must be a way to optimise this block gopt = 1 elseif ch=="b" then gopt = 2 elseif ch=="s" then gopt = 3 end platform.window:invalidate() endendfunction on.enterKey() if scrn==1 then if cc >= 100 and cc <= 10000000 and bb >= 0.001*cc and bb <= 0.1*cc and sb >= 0.01*bb and sb <= 0.5*bb then platform.gc():drawString("Congrats! Settings set up correctly",10,70,"top") scrn=2 gopt=0 else platform.gc():drawString("Check these conditions",10,70,"top") platform.gc():drawString("Chips between 100 and 10 million",10,85,"top") platform.gc():drawString("Big blind between 0.001 and 0.1 Chips",10,100,"top") platform.gc():drawString("Small blind between 0.01 and 0.5 Big Blind",10,115,"top") end endendfunction on.backspaceKey() if gopt==1 then --Ok there must be a way to optimise this block. Again. cc = string.usub(cc,0,-2) -- deleting last char elseif gopt==2 then bb = string.usub(bb,0,-2) -- deleting last char elseif gopt==3 then sb = string.usub(sb,0,-2) -- deleting last char end platform.window:invalidate() endplatform.window:invalidate()
--[[TI-nspire Hold 'em - A Lua RemakeHistory:v0.01 Created 2012/09/23 really started working 2012/10/07Buggy can hardly do anything, currently can change Chips, Big Blind, Small Blind]]--function init_variables() cc=0 bb=0 sb=0 gopt=1 scrn=1 message=""endinit_variables() function on.paint(gc) gc:setFont("sansserif","r",10) gc:setColorRGB(0,0,0) -- gc:setPen("thin","smooth") Is this necessary? if scrn==1 then gc:drawString("[c] Chips " .. cc,10,10,"top") gc:drawString("[b] Big Blind " .. bb,10,25,"top") gc:drawString("[s] Small Blind " .. sb,10,40,"top") gc:drawRect(10,70,20,20) if message=="wrong" then gc:drawString("Check these conditions",10,70,"top") gc:drawString("Chips between 100 and 10 million",10,85,"top") gc:drawString("Big blind between 0.001 and 0.1 Chips",10,100,"top") gc:drawString("Small blind between 0.01 and 0.5 Big Blind",10,115,"top") end elseif scrn==3 then gc:drawString("Right let's get rolling!",10,10,"top") end if scrn==2 then if message=="congrats" then gc:drawString("Congrats! Settings set up correctly",10,70,"top") end end endfunction on.charIn(ch) if ch >= "0" and ch <= "9" then -- checking for digit inputs if scrn==1 then if gopt==1 then if string.len(cc) <= 7 then -- limit string length cc = cc .. ch -- concatenate platform.window:invalidate() -- screen refresh end elseif gopt==2 then if string.len(bb) <= 6 then -- and sb <= 0.1bb then -- limit string length and bb to <= 0.1cc (now moved) bb = bb .. ch -- concatenate platform.window:invalidate() -- screen refresh end elseif gopt==3 then if string.len(sb) <= 6 then -- and sb <= 0.1bb then -- limit string length and sb to <= 0.1bb (now moved) sb = sb .. ch -- concatenate platform.window:invalidate() -- screen refresh end end end end--Game settings keys if scrn==1 then if ch=="c" then --Ok there must be a way to optimise this block gopt = 1 elseif ch=="b" then gopt = 2 elseif ch=="s" then gopt = 3 end platform.window:invalidate() endendfunction on.enterKey()cc=1*ccbb=1*bbsb=1*sb if scrn==2 then scrn=3 end if scrn==1 and cc >= 100 and cc <= 10000000 and bb >= 0.001*cc and bb <= 0.1*cc and sb >= 0.01*bb and sb <= 0.5*bb then message="congrats" scrn=2 gopt=0 else message="wrong" end endfunction on.backspaceKey() if gopt==1 then --Ok there must be a way to optimise this block. Again. cc = string.usub(cc,0,-2) -- deleting last char elseif gopt==2 then bb = string.usub(bb,0,-2) -- deleting last char elseif gopt==3 then sb = string.usub(sb,0,-2) -- deleting last char end platform.window:invalidate() endplatform.window:invalidate()