First "good" game - Keypad

IndigoWare 31 May 2012 01:27

Here's what I have to show for several months' worth of messing with the calculator — a 600-byte arcade game where you press the numbers 1-9 to match the star onscreen. I've named it Keypad, because I have no idea what else to name it. While playing, you can press [MODE] to quit. Does anyone have any comments, optimizations, etc.?

```
:Normal
:Full
:CLASSIC
:"1+(ℕ<7)+(ℕ<4→u
:Lbl D
:Repeat Ans
:ClrHome
:Input " TIME? (1-9999) ",D
:If not(imag(D
:not(D<1 or D>999 or fPart(D
:End
:Lbl P
:ClrHome
:12→X:5→Y:-1→S:FV→PV <FV and PV are finance variables>
:Output(1,5,"+-+-+-+
:Output(2,5,"!7!8!9!
:Output(3,5,"+-+-+-+
:Output(4,1,"TIME!4!5!6!SCORE
:Output(5,5,"+-+-+-+0
:Output(6,5,"!1!2!3!
:Output(7,5,"+-+-+-+
:Output(5,1,D
:Output(8,7,"*3*
:rand(70
:Output(8,8,2
:rand(70
:Output(8,8,1
:rand(70
:Output(8,7," <three spaces>
:For(T,D,0,-1)
:If PV=FV:prgmZKYPDNUM
:getkey→PV
:Output(5,1,T
:Output(5,2+(T>9)+(T>99)+12(T>999)," <one space>
:If PV+22:Goto X
:End
:Output(Y,X,ℕ
:Output(8,4,"GAME OVER
:Pause
:Menu("PLAY AGAIN?","YES",P,"RESET TIME",D,"NO",X
:Lbl X
:DelvarDDelvar SDelvar TDelvar XDelvar YDelvar u:0→PV:0→FV:0→ℕ
:ClrHome:"
```

For the subprogram:

```
:Output(Y,X,ℕ
:Output(1,9→ℕ
:ℕ+13(4+u→FV
:2+20fPart(FV/10→X
:S+1→S
:Output(5,12,Ans
:2u→Y
:Output(Ans,X,"*
```