Skip to content

Instantly share code, notes, and snippets.

@dontangg
Created November 7, 2015 20:51
Show Gist options
  • Save dontangg/3de83dbe7e42ea9a3d39 to your computer and use it in GitHub Desktop.
Save dontangg/3de83dbe7e42ea9a3d39 to your computer and use it in GitHub Desktop.
A game for the TI-86
ClLCD
1→NEWX
1→NEWY
21→OX
8→OY
10→NEWSX1
8→NEWSY1
15→NEWSX2
2→NEWSY2
0→TIMER
0→KEY
WHILE KEY≠22
Outpt(OY,OX,"O")
Outpt(XY,XX," ")
NEWX→XX
NEWY→XY
Outpt(XY,XX,"X")
Outpt(SY1,SX1," ")
NEWSX1→SX1
NEWSY1→SY1
Outpt(SY1,SX1,"²")
Outpt(SY2,SX2," ")
NEWSX2→SX2
NEWSY2→SY2
Outpt(SY2,SX2,"²")
getKy→KEY
If KEY==26 and XX<21
Then
XX+1→NEWX
Else
If KEY==34 and XY<8
Then
XY+1→NEWY
Else
If KEY==24 and XX>1
Then
XX-1→NEWX
End
If KEY=25 and XY>1
Then
XY-1→NEWY
End
End
End
TIMER+1→TIMER
If TIMER==1
Then
If XX>SX1
Then
SX1+1→NEWSX1
End
If XY>SY1
Then
SY1+1→NEWSY1
End
If XX<SX1
Then
SX1-1→NEWSX1
End
If XY<SY1
Then
SY1-1→NEWSY1
End
Else
If TIMER==2
Then
0→TIMER
If XX<SX2
Then
SX2-1→NEWSX2
End
If XY<SY2
Then
SY2-1→NEWSY2
End
If XY>SY2
Then
SY2+1→NEWSY2
End
If XX>SX2
Then
SX2+1→NEWSX2
End
End
End
randInt(1,4)→TEMP
If TEMP==1
End
If XX==OX and XY==OY
Then
Outpt(1,8,"You win!")
Stop
Else
If SX1==XX and SY1==XY
Then
Outpt(1,4,"You were eaten")
Outpt(2,4,"by the snake.")
Stop
End
If SX2==XX and SY2==XY
Then
Outpt(1,4,"You were eaten")
Outpt(2,4,"by the snake.")
Stop
End
End
End
ClLCD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment