Omnimaga

Omnimaga => Completed => Our Projects => BatLib => Topic started by: Xeda112358 on March 13, 2011, 02:33:32 pm

Title: BASIC ReCode v2.00
Post by: Xeda112358 on March 13, 2011, 02:33:32 pm
Now that I have put some serious work into BASIC ReCode, I figured a topic should be started to explain routines, help people out, and to share ideas. First off, here is what I have managed to make using the current version of ReCode:
(http://www.omnimaga.org/index.php?action=dlattach;topic=6412.0;attach=6557;image)
That took 809 bytes of memory, but you can see it has speed and ability. You can download a PDF of the commands and syntax below, but as a warning, the While command will fail miserably if there is an End statement inside of it. So for example:

Code: [Select]
While getKey≠15
getKey→A
If A=9
Then
Fill(2
DispGraph
End
End
This will fail because it will try to pick up at the second End when it exits the loop and that End will send the parser to another random spot in memory. This isn't a problem if the parser can reach a Stop, but it isn't likely. For now, using a trick that results from the way the parser is designed, you can avoid If Then...End statements by putting a space after non-text commands (text is read until it reaches a newline token). For example:
Code: [Select]
While getKey≠15
getKey→A
If A=9
Fill(2 DispGraph
End
It uses less memory, anyway and is faster, but I added the If Then...End form for readability.

Here is the readme to ReCode:
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 13, 2011, 02:34:33 pm
Woah! It looks awesome, seems like Axe too, really fast for an Axe program!

AWESOME.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 13, 2011, 02:35:15 pm
Oh, that's not Axe... This is an interpreted language, like BASIC!
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 13, 2011, 02:36:53 pm
Oh, that's not Axe... This is an interpreted language, like BASIC!

I know, but it is a language with BASIC's syntax but better speed and capabilities.
Not the compiled part.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 13, 2011, 02:38:46 pm
Yep ^_^ The only problem is that when I started it, I hadn't heard of Axe, so I modeled the math differently :( Apparently Axe does math in the exact opposite order as ReCode, so it could be confusing for Axe users !_!
Title: Re: BASIC ReCode v2.00
Post by: DJ Omnimaga on March 13, 2011, 02:47:06 pm
Wow that looks really fast, nice job!
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 13, 2011, 02:48:08 pm
Wait, Xeda, in the screenshot you do:

Code: [Select]
prgmBROCKEAT

No Asm( or is it DoorsCS Homerun hook? No Asm( and that speed looks great ;)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 13, 2011, 02:55:21 pm
Hehe, BASIC ReCode works inline with BASIC. in prgmBLOCKEAT, the last few lines that display score are BASIC. So for example:
Code: [Select]
ClrHome
Disp "THIS IS BASIC
dim(40
Disp 1,0,THIS IS SPARTA!
Disp 2,0,ER...I MEAN, RECODE!
Pause While getkey≠15
AsmPrgmEF4045C9
Stop
Pause "AND MORE BASIC!
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 14, 2011, 09:16:38 am
Hehe, BASIC ReCode works inline with BASIC. in prgmBLOCKEAT, the last few lines that display score are BASIC. So for example:
Code: [Select]
ClrHome
Disp "THIS IS BASIC
dim(40
Disp 1,0,THIS IS SPARTA!
Disp 2,0,ER...I MEAN, RECODE!
Pause While getkey≠15
AsmPrgmEF4045C9
Stop
Pause "AND MORE BASIC!


WOW! That's pure epic!
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 14, 2011, 01:45:45 pm
Aw, thanks! Okay, I plan to add some sprite stuff, when I got time (Mondays are my busy days). But before I do that, I want to add support for working with the BASIC strings and a second set of number vars. So for example, not only will you have A,B,C.... you will have A',B',C'..., too.

Also, I did double check and ReCode is allowed in the competition (it is in the category of Hybrid BASIC) if anybody was wondering. The same goes with BatLib :D
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 15, 2011, 02:07:34 am
Okee dokey then, I have now added several functions:

' is used to use the second set of vars (for example, A'-1→B)
" is used to use a BASIC string (for example, Text(0,0,"Str1)
RecallPic is used to copy pictures to the graph screen (for example, RecallPic 23)
StorePic is used to store the graph image to a picture (for example, StorePic 17)
Full is used to set the clock speed to 15MHz (or 6MHz if you add a 0 to the end)
Pt-On( draws a sprite using a hex string.

All string arguments must be the last on a line, so with the Pt-On( thing, you need to do something like this:
Code: [Select]
:0
:Pt-On("Str1
:8,0,0,2

I'm a bit sleepy at the moment, so I'm not going to go into too many details. If anybody has questions or ideas for changes/additions, feel free to mention them!
Title: Re: BASIC ReCode v2.00
Post by: Scipi on March 15, 2011, 06:06:04 pm
Hey with the DS<( command, can it exit a ReCode block and repeat a section of Basic? Or can it even exit one Block and enter another?

Code: [Select]
:dim(40
:Stuff here
:stop
:output(x,y,"...
:dim(40
:1
:DS<(3         (or 5)
:stop
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 15, 2011, 06:09:51 pm
It wouldn't exit ReCode, but it would try to execute the BASIC data as ReCode data. However, it would be pretty cool to make it recognise if it has gone to a point before the block! That is a cool idea! I would have to make it so that you could choose to make it exit the ReCode parser or not...

If I can add that in, I will try, but I cannot promise anything :D
Title: Re: BASIC ReCode v2.00
Post by: Scipi on March 15, 2011, 06:19:46 pm
Ok, because there appears no way to display numbers in variables like "X" or "A". Perhaps One could try jumping to an empty ReCode Block and have it exit there via the Stop command.
/me starts coding to test that out.

It works :D You just have to drop out in a ReCode block then exit.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 15, 2011, 06:21:42 pm
You mean like displaying the values of the variables? Yeah, I haven't added that, yet :D

EDIT: Added :D
Title: Re: BASIC ReCode v2.00
Post by: yunhua98 on March 17, 2011, 10:42:33 am
wow!  That looks awesome, how did I not notice this before?/me wonders if another "Axe" is here...
Quigibo needs to watch his back now. :P
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 17, 2011, 12:32:13 pm
Well it isn't quite as fast  as Axe because it has to convert all of the numbers on the fly. The main difference between Axe and this is that ReCode is interpreted so most codes should be smaller than an Axe program. Plus, you can use assembly, BASIC, and ReCode in the same program :D

With that in mind, I think my goal over the summer will be to create an app that takes total control of the RAM and is solely an environment to create and execute programs. It will not use the OS whatsoever. The problem with that, though, is that I will need to have a way to eventually give control back to the OS (for linking and to use the calc as a calc :D)
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 19, 2011, 07:55:02 am
wow!  That looks awesome, how did I not notice this before?/me wonders if another "Axe" is here...
Quigibo needs to watch his back now. :P

Well it isn't quite as fast  as Axe because it has to convert all of the numbers on the fly. The main difference between Axe and this is that ReCode is interpreted so most codes should be smaller than an Axe program. Plus, you can use assembly, BASIC, and ReCode in the same program :D

With that in mind, I think my goal over the summer will be to create an app that takes total control of the RAM and is solely an environment to create and execute programs. It will not use the OS whatsoever. The problem with that, though, is that I will need to have a way to eventually give control back to the OS (for linking and to use the calc as a calc :D)

Xeda, don't be modest, yunhua98 is right, this is looking pretty awesome.

Can you make an example with smoothscrolling?
Title: Re: BASIC ReCode v2.00
Post by: AngelFish on March 19, 2011, 08:03:17 am
I want to give some respect points, but Xeda's respect is the perfect square of 12...  :P
/me gives it anyway.
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 19, 2011, 08:04:44 am
I want to give some respect points, but Xeda's respect is the perfect square of 12...  :P
/me gives it anyway.

I'll take away her respect to to be 12^2 again >D
Title: Re: BASIC ReCode v2.00
Post by: TIfanx1999 on March 19, 2011, 08:43:35 am
Xeda this IS awesome. The fact that BASIC or ASM can be integrated with no effort make it unique. I'm very interested to see where you take this. :D
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 19, 2011, 08:54:32 am
I also like the fact that we have a fast interpreted langauge.
Title: Re: BASIC ReCode v2.00
Post by: ztrumpet on March 19, 2011, 11:09:55 am
Wow, I just saw the thing about A' (and the other vars).  That's awesome! ^-^
Great job on this, Zeda. :)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 19, 2011, 02:05:50 pm
Can you make an example with smoothscrolling?
My next command goal is to make use of pointers to data and the ability to read and write data. From there, I can make use of the sprite commands and possibly make a smoothscrolling thing :)
I want to give some respect points, but Xeda's respect is the perfect square of 12...  :P
/me gives it anyway.
Aww, now I need 18 more :( !_!
Title: Re: BASIC ReCode v2.00
Post by: Munchor on March 19, 2011, 02:22:19 pm
Can you make an example with smoothscrolling?
My next command goal is to make use of pointers to data and the ability to read and write data. From there, I can make use of the sprite commands and possibly make a smoothscrolling thing :)
I want to give some respect points, but Xeda's respect is the perfect square of 12...  :P
/me gives it anyway.
Aww, now I need 18 more :( !_!

Give us a smoothscrolling example (sprites and all that stuff, pointers, etc) and you'll have a few more :)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 19, 2011, 05:40:01 pm
Aw, I added pointers and some new things and I tried making a tilemap routine in ReCode... :(
It took 25/64 of a second to produce and display a tilemap. That means it can only produce 5 tilemaps in 2 seconds which doesn't look smooth at all :( Anywho, the new commands and syntax are:

Pt-Off( copies some bytes from a var to a fixed RAM area and returns a pointer to it in Ans
using {#,Size instead of a string will use the bytes at address # as data.
Title: Re: BASIC ReCode v2.00
Post by: DJ Omnimaga on March 26, 2011, 10:59:16 pm
Well it isn't quite as fast  as Axe because it has to convert all of the numbers on the fly. The main difference between Axe and this is that ReCode is interpreted so most codes should be smaller than an Axe program. Plus, you can use assembly, BASIC, and ReCode in the same program :D

With that in mind, I think my goal over the summer will be to create an app that takes total control of the RAM and is solely an environment to create and execute programs. It will not use the OS whatsoever. The problem with that, though, is that I will need to have a way to eventually give control back to the OS (for linking and to use the calc as a calc :D)
That would be nice. It would be great if we could create/read from appvars like Axe does if it's not possible already, and use them as memory areas to store data. I guess safeRAM areas would be out of the question, though. X.x
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 27, 2011, 01:25:14 am
For now I will need to, but if I do make that programming environment, I am going to be writing my own variable structures and VAT, so there will be more RAM to be used and there will be vars that ReCode can use. My plans are to add these vars:
Pictures (variable size?)
Programs
Strings
Lists
Matrices
Numbers
Data
Title: Re: BASIC ReCode v2.00
Post by: DJ Omnimaga on March 27, 2011, 05:38:26 pm
Ah nice, but I wonder how it would work in BASIC, since the other RAM is used by the OS sometimes in BASIC?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on March 27, 2011, 05:42:24 pm
Oh, that version would not use BASIC at all :( It would use its own tokens, its own variables, et cetera and it would only work with the OS through entering or exiting the environment.
Title: Re: BASIC ReCode v2.00
Post by: DJ Omnimaga on March 27, 2011, 05:52:09 pm
Oh ok, you mean it would kinda be a totally new language where BASIC cannot be used, like MLC and BBC Basic, but using the PRGM editor, unlike BBC Basic?
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 05, 2011, 08:04:32 pm
Is there a stand-alone thing for recode, or does it only run with Batlib?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 05, 2011, 09:44:20 pm
What do you mean by stand alone? For now, ReCode is available only with BatLib because it uses BatLib routines and because apps always use multiples of 16384 bytes (even if it only has 1 byte of actual code). So, since both still fit on one app page (and there is still over 5000 bytes of code space left before it fills up), I have the two combined. I could make a ReCode app, but to ensure compatibility, it would still require dim(40 to begin ReCode. So if you want, you can think of BatLib as ReCode with BatLib included XD
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 06, 2011, 07:29:06 am
So Xeda, have you added comments to BatLib yet?

Wondering, since I'm starting to program in BatLib today :D
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 06, 2011, 08:54:31 am
I have not added it, but it won't be difficult. Is there a token in particular that should start a comment? I was thinking a newline followed by a space...
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 06, 2011, 08:59:24 am
I have not added it, but it won't be difficult. Is there a token in particular that should start a comment? I was thinking a newline followed by a space...

I'd like it to be // like in most languages, or at least something that's not a space, the space is hard to spot and some people might want to use identation.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 06, 2011, 09:10:06 am
I can probably do that as well as make a space a null character. Still, I think space are easy to spot since the screen is so small :P
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 06, 2011, 09:10:55 am
I can probably do that as well as make a space a null character. Still, I think space are easy to spot since the screen is so small :P

What about indentaters?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 06, 2011, 09:12:46 am
Yeah, I will leave spaces as null commands.
Title: Re: BASIC ReCode v2.00
Post by: Scipi on April 06, 2011, 07:48:27 pm
I think // is best for comments (c++ programmer here XD ) Also, if you haven't added it already, will you add a command to display a variable?

Edit: 200th post! XD
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 06, 2011, 07:54:26 pm
Do you mean like display A or A'? For that you can use log(Text( and it will display the value in some base. If you omit the base, it automatically outputs in base 10 :)
Title: Re: BASIC ReCode v2.00
Post by: Scipi on April 07, 2011, 03:34:16 pm
Oh ok I see, thx. (I gotta update batlib on my calc soon x.X ) :P
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 07, 2011, 03:39:25 pm
Yeah, I plan to make a new update soon, anyway. I have to fix >, I have added // comments as well as 2 other commands. I am working on command 93 which will let you insert a list somewhere inside another list. I also need to add 3 more commands to do that for strings (deleteing bytes, inserting, and inserting other strings).
Title: Re: BASIC ReCode v2.00
Post by: Ashbad on April 07, 2011, 03:43:38 pm
Hmm, // comments?  Thats actually very nice, I was tired of only having a string stored to Ans as a possiblility in BASIC.  Nice work :D
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 07, 2011, 03:45:44 pm
Hehe, thanks :) I was actually a little iffy about using //, but it really does look nice :) Also, it only works after a newline and it pretty much just skips the whole line and moves to the next one when it reaches a //

Does anybody else have any coding conventions that I should add?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 07, 2011, 03:46:34 pm
Hehe, thanks :) I was actually a little iffy about using //, but it really does look nice :) Also, it only works after a newline and it pretty much just skips the whole line and moves to the next one when it reaches a //

Does anybody else have any coding conventions that I should add?

/*

*/ Maybe for multiline comments.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 07, 2011, 03:51:56 pm
How would it work? Can you give an example?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 07, 2011, 03:53:04 pm
How would it work? Can you give an example?

As in most PC languages:

Code: [Select]
/*
All these lines are comments
The goal of this program
is to clear the
screen/LCD
*/
dim(40
Fill(0
//The last line clears the screen
Stop
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 07, 2011, 03:57:10 pm
Okay, then in that case maybe I can make it so that if you do /Then, the comment will end with an End statement (to save a byte?) Would that work?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 08, 2011, 11:29:47 am
Okay, then in that case maybe I can make it so that if you do /Then, the comment will end with an End statement (to save a byte?) Would that work?

Yes, it would :D
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 09, 2011, 12:50:41 pm
I just realised that I will need to change the Pause While command because it will cause problems if it is inside of another block (the parser reads the "While" and expects another End). So I am thinking of changing it back to Pause If like I once had it. Does anybody have any better suggestions?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 11, 2011, 05:16:10 am
I highly recommend adding Goto and Labels if you can :)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 11, 2011, 08:15:56 am
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 11, 2011, 09:54:19 am
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 11, 2011, 08:54:52 pm
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?
Sorry, I don't know what you mean :/ In TI-BASIC, labels can be letters or numbers and can either be 1 or 2 of them in any combination. I know in a lot of other programming languages, you can make longer labels than that. I am not sure if I want to add label support for that or not. If I keep it at a one or two byte limit, it will be faster :)
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 12, 2011, 07:40:17 am
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?
Sorry, I don't know what you mean :/ In TI-BASIC, labels can be letters or numbers and can either be 1 or 2 of them in any combination. I know in a lot of other programming languages, you can make longer labels than that. I am not sure if I want to add label support for that or not. If I keep it at a one or two byte limit, it will be faster :)

I meant, you said Labels will have a limited range, so I guessed you would only use 18** for labels (in the hex code).
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 12, 2011, 10:12:06 am
I don't remember saying that... :/ Also, BatLib doesn't work that way, so it wouldn't use a jr :P There is a pointer stored in RAM that tells where the next byte to parse is. Actually, I use the same pointer as the BASIC parser, which is why when it reaches "Stop" the BASIC program pics up where it left off. That is also why ReCode can execute after C000h
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 12, 2011, 10:55:40 am
I don't remember saying that... :/ Also, BatLib doesn't work that way, so it wouldn't use a jr :P There is a pointer stored in RAM that tells where the next byte to parse is. Actually, I use the same pointer as the BASIC parser, which is why when it reaches "Stop" the BASIC program pics up where it left off. That is also why ReCode can execute after C000h

I misunderstood this:

Quote
nd I don't know if I want to add support for long labels or just one

Sorry.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 12, 2011, 04:31:16 pm
Sorry about that :/
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 13, 2011, 04:20:05 am
Sorry about that :/

No problem, but numbered labels are good too :D
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 15, 2011, 09:39:42 pm
Is there a kill switch, like ON in basic?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 16, 2011, 12:31:24 am
No, not yet :/ I have to figure out interrupts and then I can do that :)
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 16, 2011, 01:44:15 pm
I would like ON to break if the coder allows it. So for debugging I'll turn it on but for releases I won't.
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 16, 2011, 08:30:16 pm
That would be handy if you got stuck ;)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 16, 2011, 08:31:24 pm
Hmm, then I guess I will have to make another effort at learning how to make interrupts :/

Also, I am getting ready for the next BatLib update :)
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 16, 2011, 08:33:20 pm
Hmm, then I guess I will have to make another effort at learning how to make interrupts :/

Also, I am getting ready for the next BatLib update :)

Awaiting it anxiously :)
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 17, 2011, 11:05:43 am
If you make a kill swich, there should be a command to turn it off/on like what scout was saying.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 11:13:27 am
That would be an excellent idea! Like a command to do that... Also, I was thinking that maybe the user could specify a kill switch or a combination?
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 17, 2011, 11:22:44 am
That would good. You could then make a password program just by starting a loop, and waiting for the key combo to break the program. I was also wondering how much faster Recode is than Basic.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 11:26:15 am
Well,, if you check the screenshots, with graphics, ReCode is much faster. So if you are making a game, ReCode is great for graphics rendering, especially when you have 15MHz mode. If you checkout the Block Eater example made first in BASIC, then ReCode, I would say that it is several times faster in ReCode.
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on April 17, 2011, 11:35:53 am
I figured out why recode was looping! Key codes are different!
Do you have a chart?
 
Edit: New record! I cleared my ram 9 times since I started playing with recode!
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 12:50:19 pm
hehe! As long as you are having fun, RAM clears aren't bad :D Um, it uses the same key codes as xLIB and Celtic 3 (the real(8 command) I will look for a chart and include it in the readme at some point, too.

Really quickly, though, 9=Enter, 15=Clear, 55=Mode, down=1, up=4, left=2, right=3

If you run this code, it will return the keycodes:
Code: [Select]
Lbl 0
dim(43
If Ans and Ans≠A
Then
Ans→A
ClrHome
Output(1,1,Ans
End
Goto 0
You It will return individual values for two key presses, too, so the highest value (mode+del) will return 3247
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 17, 2011, 01:20:19 pm
Zeda: Thanks for the code on how to dim(56 inside ReCode blocks =D
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 01:22:38 pm
dim(56 has some drawing functions... Is that the command you are talking about?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 17, 2011, 01:24:33 pm
dim(56 has some drawing functions... Is that the command you are talking about?

I mean dim(52 for displaying hex data sprites.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 01:28:35 pm
Ah, okay :D I will explain this one to others who haven't used the trick before... In ReCode, you can pass string arguments, but they are ended by a newline, not an end quote. So, if you want to use dim(52 in ReCode to display a sprite, instead of doing dim(52,"3C4281818181423C",8,0,0,0:
Code: [Select]
:dim(40      ;to start the ReCode block
:dim(52,3C4281818181423C
:8,0,0,0
:DispGraph
:Stop
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 17, 2011, 01:29:30 pm
I would call it half a trick and half a bug :P I'd rather have Recode Stings working properly :P
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 01:31:54 pm
Well I included it that way because I wanted people to be able to use tokens like " and → for data :P If you were to use dim(53 or Disp, you might want to use tokens :P I did purposefully make it so that you need a newline to end it :)
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 17, 2011, 01:32:30 pm
Well I included it that way because I wanted people to be able to use tokens like " and → for data :P If you were to use dim(53 or Disp, you might want to use tokens :P I did purposefully make it so that you need a newline to end it :)

Then it'll be left like this? Cool enough :) Maybe include that in the next readme.
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 17, 2011, 01:33:40 pm
There is another method I included that is buggy, though :/
Title: Re: BASIC ReCode v2.00
Post by: Hot_Dog on April 18, 2011, 05:46:14 pm
Seeing as I let you use the Correlation idea for creating a backup of data when library compatability is needed, perhaps I can borrow this idea? :D :D

Basic ReCode gave me the idea to create "Correlation IF"--taking over program reading to speed up the process of moving Correlific Mode sprites from one X/Y coordinate to another one
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 18, 2011, 08:20:28 pm
Sure, that is fine with me :) I am sure there will be plenty of happy programmers if you do that :)
Title: Re: BASIC ReCode v2.00
Post by: Hot_Dog on April 18, 2011, 08:44:20 pm
Sure, that is fine with me :) I am sure there will be plenty of happy programmers if you do that :)

True dat ;D
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 19, 2011, 06:56:31 am
Is this anything about mixing Libraries?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on April 19, 2011, 09:17:02 am
No, Hot_Dog seems to want to have fun making his own programming language :) It isn't about mixing libraries :P
Title: Re: BASIC ReCode v2.00
Post by: Munchor on April 19, 2011, 09:18:40 am
No, Hot_Dog seems to want to have fun making his own programming language :) It isn't about mixing libraries :P

Thanks, I really didn't understand what he meant.
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on June 19, 2011, 12:01:42 pm
Am I correct to assume that Grammer will replace recode in batlib?
Title: Re: BASIC ReCode v2.00
Post by: Munchor on June 19, 2011, 12:14:24 pm
Am I correct to assume that Grammer will replace recode in batlib?

I'd vote in favour, indeed, Grammer as the new language.
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on June 19, 2011, 12:19:58 pm
I agree, I would definitely like to see grammer with Batlib
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on July 18, 2011, 02:34:31 pm
I was wondering what others would think about that idea... So once I get BatLib all converted I can just insert Grammer in there :) Grammer is simply a whole lot safer (as safe as BASIC) and has more advanced features. I'll see what I can do in  the next few months :D
Title: Re: BASIC ReCode v2.00
Post by: Scipi on July 18, 2011, 03:05:28 pm
I would like Grammer with Batlib, as long as there's still the option to still use ReCode. (ReCode in Grammer or vice versa?)
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on July 19, 2011, 03:41:55 pm
I could keep both, but let ReCode piggyback on the more stable ReCode code. That should hopefully make ReCode safer...
Title: Re: BASIC ReCode v2.00
Post by: Munchor on July 24, 2011, 10:29:43 am
I would like Grammer with Batlib, as long as there's still the option to still use ReCode. (ReCode in Grammer or vice versa?)

I thought of having both, but that would make BatLib huge, right?
Title: Re: BASIC ReCode v2.00
Post by: mrmprog on July 24, 2011, 10:57:21 am
It seems a little redundant. What are the differences between Grammer and Recode?
Title: Re: BASIC ReCode v2.00
Post by: Xeda112358 on July 28, 2011, 08:09:52 pm
The main differences are a few more advanced features and Grammer is much more safe. For example, with Grammer you can press [ON] in case you make an infinite loop or do something similar whereas ReCode does not allow this. Also, Grammer gives you the option of things like sub routines, labels, and more advanced math. If I kept ReCode, it would only use calls to Grammer code so it would use only a little memory.