![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2008
Posts: 8
Rep Power: 0
![]() |
Snake in C-Lesh
I programmed a game called Snake which is a simplified version of Nibbles in a language I wrote called C-Lesh. The language is made to recreate the programming environment of the TI-28 which I enjoyed because of the challenges of programming in a minimal language. Here's my version of that called C-Lesh. Below is the Nibbles program I wrote in this language.
// Simple Snake Program
// Taken from "http://timjoh.com/simple-snake-game-in-ti-basic".
// Use the j, i, l, and m to control the worm. You can only run
// into yourself three times before losing. Good luck!
) 1 1 Snakes ) 1 2 Modified\sby\sFrancois. ) 1 3 Push\sENTER\sto\sstart.
? @k ! 13 L
[
k => @k // Store keystroke.
]
~
m @x <= 16
m @y <= 8
m @d <= 1
? @c = 0 L // Infinite loop.
[
m @o <= Score:\s . @s
) 0 0 @o
k => @k
? @k = 106
[
m @d <= 1 // Left
]
? @k = 105
[
m @d <= 2 // Up
]
? @k = 108
[
m @d <= 3 // Right
]
? @k = 109
[
m @d <= 4 // Bottom
]
? @d = 1
[
m @x <= @x - 1
]
? @d = 2
[
m @y <= @y - 1
]
? @d = 3
[
m @x <= @x + 1
]
? @d = 4
[
m @y <= @y + 1
]
t @x @y => @p
? @p = * // We hit ourselves.
[
m @a <= @a + 1
? @a > 2
[
~ .
]
]
) @x @y *
m @s <= @s + 1 // Raise the score for survival.
_ 100 // Wait 100 milliseconds.
]The interpreter is delivered as an attachment so that you can run this game. Read the docs so that you understand the language. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 194
Rep Power: 1
![]() |
Re: Snake in C-Lesh
" C-Lesh died with message: Missing Parameter. "
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2008
Posts: 8
Rep Power: 0
![]() |
Re: Snake in C-Lesh
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 194
Rep Power: 1
![]() |
Re: Snake in C-Lesh
Probably a dumb question...
How do I do that? ![]()
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#5 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,033
Rep Power: 5
![]() |
Re: Snake in C-Lesh
Use the command line, or go to Start -> Run, and then type the full path to the program, and the full path to the .clesh script.
Alternatively, you could make a new shortcut, and add the script to the 'Target' line, but that's overkill. The command line is quickest and easiest, and you can go on to Microsoft's site and search for the 'create command prompt here' PowerToy. This allows you to right-click a folder in Explorer, and have a context-menu choice to open a prompt with that folder as the current working directory. For testing command-line stuff, it's rather convenient.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 194
Rep Power: 1
![]() |
Re: Snake in C-Lesh
What I did was open the command prompt window, and drag the .exe file into it, then pressed Enter to run the application. That's when I received the error.
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#7 | |
|
Newbie
Join Date: Jul 2008
Posts: 8
Rep Power: 0
![]() |
Re: Snake in C-Lesh
Quote:
If you need any more help feel free to ask. Have fun with C-Lesh! |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java Snake Game I made by my self | msi_333 | Java | 0 | May 29th, 2007 11:44 AM |
| Desktop Snake | jeffball55 | Show Off Your Open Source Projects | 5 | Mar 28th, 2006 3:05 AM |
| Turbo C++ Snake Problem | lilmul123 | C++ | 1 | Mar 17th, 2006 6:44 AM |