Author Topic: BASIC ReCode v2.00  (Read 55682 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
BASIC ReCode v2.00
« 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:

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:

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #1 on: March 13, 2011, 02:34:33 pm »
Woah! It looks awesome, seems like Axe too, really fast for an Axe program!

AWESOME.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #2 on: March 13, 2011, 02:35:15 pm »
Oh, that's not Axe... This is an interpreted language, like BASIC!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #3 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.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #4 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 !_!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BASIC ReCode v2.00
« Reply #5 on: March 13, 2011, 02:47:06 pm »
Wow that looks really fast, nice job!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #6 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 ;)

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #7 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!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #8 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!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #9 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

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #10 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!

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: BASIC ReCode v2.00
« Reply #11 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

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #12 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

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: BASIC ReCode v2.00
« Reply #13 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.
* HOMER-16 starts coding to test that out.

It works :D You just have to drop out in a ReCode block then exit.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #14 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