

Use the cursor keys to control movement direction. Locate 10, 18: Print "Has muerto! Con" puntos " puntos." : Sleep If posX = x (contar ) And posY = y (contar ) Then convida = false

If direccion = "izquierda" Then posX -= 1 Locate posY, posX: Print Chr ( 219 ) '"Û" If oldX > 0 And oldY > 0 Then Locate oldY, oldX : Print " " OldX = x (longitud ) : oldY = y (longitud ) Locate fruitY, fruitX : Color 12: Print Chr (01 ) : Color 10 ( 0 ) = posX : y ( 0 ) = posY Locate 23, 2: Print "SNAKE - salir - Puntos: " puntos Locate 14, 4: Print "M xima puntuaci¢n: " oldhi Print " \_/- para velocidad, o para salir." BASIC FreeBASIC ĭim Shared As Integer puntos, contar, longitud, posX, posY, oldhi = 0ĭim Shared As Integer x ( 500 ), y ( 500 )ĭim Shared As Byte fruitX, fruitY, convida MsgBox, 262180, ,% "Your Score is " Score "`nPlay Again?" GuiControl, EditGrid , % grid2Text (oGrid ) GuiControl, Score , % "Your Score = " ++Score || ( ( A_ThisHotkey = "Down" ) & (Direction = "Down" ) )Ĭase "Right" : oGrid := 1 || ( ( A_ThisHotkey = "up" ) & (Direction = "up" ) ) || ( ( A_ThisHotkey = "left" ) & (Direction = "left" ) ) || ( ( A_ThisHotkey = "right" ) & (Direction = "right" ) ) || ( ( A_ThisHotkey = "Down" ) & (Direction = "up" ) ) || ( ( A_ThisHotkey = "up" ) & (Direction = "Down" ) ) || ( ( A_ThisHotkey = "left" ) & (Direction = "right" ) ) If ( ( A_ThisHotkey = "right" ) & (Direction = "left" ) ) Width := 100, Height := 30 set grid size Gui, add, Text, vScore x10 y + 10 w200 ReadOnly , % "Your Score = " Score Gui, add, Edit, vEditGrid x10 y10 ReadOnly , % grid2Text (oGrid )
