Omnimaga > BatLib

BatLib/ReCode Examples

<< < (2/7) > >>

Munchor:

--- Quote from: ztrumpet on April 09, 2011, 12:48:17 pm ---I still don't understand how the chaining works; my brain doesn't comprehend the awesome. ;D
What if you leave arguments out of a command?  How does it know to go on to the next command?

--- End quote ---

That's true, we can't forget any argument, but it makes code much smaller.

Zeda, does it count number of arguments to get to the next command?

Xeda112358:
No, it takes the first argument to decide which command to execute and then the command will use any arguments necessary. When the command is finished, it reads the next argument to figure out the next command. If BatLib reads a string when it expects a number, though, it reads the number as 0 and waits at the string until it is needed. That is why you can omit arguments before a string, even when stringing commands together :)

Munchor:
Zeda, since I like to keep it clean, here's my code for your example:


--- Code: ---:dim(40
:Fill(0
:Stop
:6→D
:DelVar B0→C
:Repeat A=15
:dim(29,B,8,C,8,2,99,10,3,43,29,B,8,C,8,2→A
:max(0,min(88,B+Dsum(DeltaList(A={2,3→B
:max(0,min(56,C+Dsum(DeltaList(A={4,1→C
:End

--- End code ---

This cleans the screen and we don't have to see the ugly screen of BatLib App.

Xeda112358:
Yeah, I just needed to show that the cursor doesn't change what is underneath it :)

Munchor:

--- Quote from: Xeda112358 on April 10, 2011, 11:33:36 am ---Yeah, I just needed to show that the cursor doesn't change what is underneath it :)

--- End quote ---

Can you add a getKey for 2ND that will change it? So, if you press 2ND, it will dim(29,BB,8,C,8, turning to black the place where the cursor is.

So, like a paint program.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version