Author Topic: BatLib  (Read 146672 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #300 on: April 08, 2011, 01:32:48 pm »
I could, but I opted not to XD I figured lines were easier to count than tokens.

On another note, I am going to be late for an appointment so I need to go, but here is the newest update of BatLib. I will go into more detail later about the fixes and added stuff :)

It's on my calculator already.

I see the source code is included =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: BatLib
« Reply #301 on: April 08, 2011, 03:59:23 pm »
Hehe, yep :) Okay, so here are all of the additions and fixes:
-fixed up the > command in ReCode
-added commenting to ReCode using //
-In the last version, I added the ability for the newer commands to use either the number of a list or direct lists. Now all list options can be either the list number (0=L1, 1=L2), a name (like "LHELLO") or a direct list (like {0,1,2,5}).
-Added DelElements command. This lets you delete elements from a list at a given offset. I didn't know of an easy BASIC method.
-Added InsElements command. This lets you insert zeros into a list at a given offset.
-Added InsList command. This inserts a list into another list at a given offset

As a note, there is no error checking for deleting or inserting elements outside of the list, so take care not to do that. Other than that, I cannot think of any other additions or fixes :)

EDIT: Also, I added some stuff that I use to develop BatLib as well as the "source" that I use to compile XD

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BatLib
« Reply #302 on: April 08, 2011, 04:09:07 pm »
Oooh, cool.  I really like the added three commands, though I take pride in knowing how to do it as easy as possible in basic. :P  Nice work, Xeda! ;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: BatLib
« Reply #303 on: April 08, 2011, 04:13:35 pm »
Is there an easy way to do it in BASIC? I know how, but the code was a bit time consuming compared to this. Also, in the next update I plan to have it so that if you try to insert or delete zero elements, it gets read as 1. That way any extreme optimisers out there can omit that argument if they simply want to do one element :D Also, I have to add in the /Then...comments...End command to ReCode (which is only 5 bytes of code to add XD).

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #304 on: April 08, 2011, 04:27:00 pm »
An example of BatLib // comments.


Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BatLib
« Reply #305 on: April 08, 2011, 04:42:11 pm »
Is there an easy way to do it in BASIC? I know how, but the code was a bit time consuming compared to this.
No, it's quite difficult.  For instance, the "easy" way to do command 91 (deleting) would be like this, assuming A holds the element to start deleting at, B holds the number of elements to delete, and Ans holds the list:
augment(seq(Ans(I),I,1,A-1),seq(Ans(I),I,A+B,dim(Ans
Easy, huh?  ::)
« Last Edit: April 08, 2011, 04:42:50 pm by ztrumpet »

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: BatLib
« Reply #306 on: April 08, 2011, 04:46:19 pm »
Yep, easy enough XD Now to do command 92 and 93 you would need 2 augments, right? And that is without Ans as an input and you would need to use If statements for when adding or deleting at the beginning or end XD So I guess I'm glad I made those commands...

:D

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BatLib
« Reply #307 on: April 08, 2011, 04:58:46 pm »
That's true...
For command 91 to work at the beginning or end, this is how it would have to look:
:augment({0},augment(Ans,{0
:augment(seq(Ans(I),I,1,A),seq(Ans(I),I,A+B+1,dim(Ans
:seq(Ans(I),I,2,dim(Ans)-2
« Last Edit: April 08, 2011, 04:59:30 pm by ztrumpet »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #308 on: April 10, 2011, 02:04:15 pm »
BatLib Doubt:

Inside a block:

Code: [Select]
Repeat A=15

End

How to check if the user presses a key (that is not [CLEAR]).

This is Basic, not Recode, but it's for BatLib purposes, so I posted it here.

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: BatLib
« Reply #309 on: April 11, 2011, 08:24:41 am »
In just wanted to make a note that your question was resolved on IRC XD I do not know how long it will be until the next update, but here are some things I am thinking of adding:
-String routines similar to the last three list commands
-an Input routine for ReCode
-Lbl/Goto for ReCode?
-Maaaaaaybe a routine, finally, for jumping to labels or spots in other programs

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #310 on: April 11, 2011, 08:39:33 am »
I really really want strings, sprites and Goto/Lbl in Recode, that would make it super awesome and almost finished.

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: BatLib
« Reply #311 on: April 11, 2011, 08:41:42 am »
Yeah, if I can correct the strings and finalise the sprite commands, that would be awesome :) I also need to add in tilemapping and data editing while I am at it :)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib
« Reply #312 on: April 11, 2011, 09:56:12 am »
Yeah, if I can correct the strings and finalise the sprite commands, that would be awesome :) I also need to add in tilemapping and data editing while I am at it :)

If you could make sprite display like in Axe would be awesome:

Code: [Select]
Pt-On(X,Y,Pic     ;Type
;Example:
[[FFFFFFFFFFFFFFFF]->Pic1
Pt-On(0,40,Pic1

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: BatLib
« Reply #313 on: April 11, 2011, 11:34:30 am »
That's true...
For command 91 to work at the beginning or end, this is how it would have to look:
:augment({0},augment(Ans,{0
:augment(seq(Ans(I),I,1,A),seq(Ans(I),I,A+B+1,dim(Ans
:seq(Ans(I),I,2,dim(Ans)-2
How about seq(Ans(I+B(I≥A)),I,1,dim(Ans)-B :D
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BatLib
« Reply #314 on: April 11, 2011, 04:03:05 pm »
That's true...
For command 91 to work at the beginning or end, this is how it would have to look:
:augment({0},augment(Ans,{0
:augment(seq(Ans(I),I,1,A),seq(Ans(I),I,A+B+1,dim(Ans
:seq(Ans(I),I,2,dim(Ans)-2
How about seq(Ans(I+B(I≥A)),I,1,dim(Ans)-B :D
Nah, too simple...
*facepalm*
Nice one.  Time for me to hide in a corner of shame... :-\