Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.

Am I right when I call this useless?
Yes
 60%  [ 3 ]
No
 40%  [ 2 ]
Total Votes : 5

So, some time ago I was asked to simplify TI-Basic by a lazy classmate, who didnt want to learn TI-Basic.

A Freind at school wrote:
"I Find that TI-Basic is too much work to understand. could you make something that would write code and run it, for me?"


so I made Ignition, which is an ugly-@$%& interpreted programming language. I have included the project in the dropbox link here:
https://dl.dropboxusercontent.com/u/107246250/IGNITION.8xg

essentially, this nasty peice of work isnt like many other programming languages. EVERYTHING is data. simply when data is recognised as a key, then execution occurs. only when data has a label in front of it can it be accessed.

these are the commands, with the closest definition following:

Code:
:
-)Creates a label. follows BATCH type. ex: ":LABEL"

Jump x
-)Causes the interpreter to find the first label with the text x, and continues execution there.

Comp
-)Compares Var1 to Var2. if false, the following line is skipped.

Load Var#,x
-)Stores the value after label x to Var#

Save Var#,x
-)Stores the value in Var# to the line after label x
-))Not implemented into the TI-Basic interpreter yet.

Swap Var#,Var#
-)Saves the data from the first Var# to the second Var#

Clear
-)Clears all text on the screen

Print
-)Prints the data in Var1

Input
-)Gets a string and stores it to Var1

Rand x
-)creates a random number from 0 to x

Quit
-)Ends program execution. in the TI-Basic interpreter, this is often neccesary.

Math x
-)performs operator x (+,-,/,*) to Var1 and Var2, storing the contents in Var1.

igni
-)more a header to make sure the interpreter doesnt attempt to run bad code.

name:x
-)supposed to be the name of your program, to get around TIOS shortnames, but since the program is in a string, it doesnt do anything. also, isnt neccesary for the interpreter.

type:x
-)supposed to be the type of your program. i often call mine "Game", "Utility", or "Other".
I hope I got all of them. I may have forgotten one or two.

One extra note. To do anything, you have to load the data from your program into Var1, Var2, or Var3.

Example programs:
Hello World:

Code:

igni
name:HiWorld
type:other
:Start
Load Var1,String1
Print
Quit

:String1
Hello World!
:EOF
Quit

Random Number Guessing Game:

Code:

igni
name:Guess my number
type:game
:Start
Clear
Rand 10
Swap Var1,Var2

:Game
Load Var1,message1
Print
Load Var2,message2
Print
Input
Comp
Jump Win
Load Var1,msgLose
Print
Jump Game

:Win
Load Var1,msgWin
Print
Quit

:message1
Guess my number
:message2
any, 1-10
:msgLose
Try Again
:msgWin
You guessed right!
:EOF
Quit


Slightly optimized Random Number Guessing Game

Code:

igni
name:Guess my number
type:game
:Start
Guess my number
Clear
Rand 10
Swap Var1,Var2

:Game
any, 1-10
Load Var1,Start
Print
Load Var2,Game
Print
Input
Comp
Jump Win
Load Var1,EOF
Print
Jump Game

:Win
You guessed right!
Load Var1,Win
Print
Quit

:EOF
Try Again
Quit


As you can see, I dont think this language would be any use to anyone. ever. its horribly made, and cant do squat. it isnt even similar to any languages I have heard of (if you can prove me wrong, ill laugh, and likely puke, too). so,its mainly as a joke.

however, when spud needed a weak language to run for his userscript (Forum Here), immediately my mind drifted to Ignition, and so I have reawakened it. who knows, I may even work on an Asm-based interpreter for it, so execution is at least faster.

If anyone can find a use for this, go ahead and post.
Unfortunately I don't think I'll be able to work with this syntax but I can try to make a really simple interpreter in javascript. It probably wont come out looking great but I think I might be able to get it to work
That actually sort of resembles ASM code.

Technically, all interpreted programming languages can be thought of as data (to the interpreter). Wink
Travis wrote:
That actually sort of resembles ASM code.

I did pull some inspiration for the commands from ASM, but they don't behave entirely similar.

Travis wrote:
Technically, all interpreted programming languages can be thought of as data (to the interpreter).

understandable, though I meant it more in the sense that unrecognized stuff is ignored, instead of causing a crash.
to help spud with his project, i am going to put in psuedocode how the engine operates.

Code:

Grab first 4 tokens of the program (in this case, the string)
If *grabbed-tokens* != Igni
{
    Display Error "Wrong file type"
    End Engine Execution
}
While *Current-Line-position* << the length of the string
{
    Increment *Current-Line-position* to the next '
    Increment *Next-line-position* to the next ' after the *Current-Line-Position*
    Retreive the contents in between *Current-Line-Position* and *Next-Line-position*
   
    If *Contents* == %Insert Basic Keywords Here%
    Call %some Function%
        //this checks for basic stuff, like Clear and Input.
   
    If First-4-Tokens(*Contents*) == %Insert Keywords Here%
    Parse remaining arguments and store somewhere for function to access
    Call %some Function%
}



As it is in TI-Basic right now, any time you hit a Call, just replace it with "Then:%%%Some code that was to be called%%%:End".
A bad language? Get this language on esolangs.org!

...

I especially like how labels are used for basically everything and how difficult math operations are.
I don't see how basic math is difficult. just store one number in Var2 and another into Var1, and execute a "Math <operator that is +,-,*,or />". your answer is stored to Var1. you can use Var3 as a backup to Var1 if you think that you will need the first number back.

If your talking about advanced mathematics, then I understand, since you must hand-solve everything. maybe I could fix that after I write the z80 implementation.

Edit: request accepted. you can find Ignition on Esolang.org
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement