BatLib/ReCode Examples
Munchor:
Quote from: ztrumpet on 09 April, 2011, 18:48:17
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?
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: Select All | Copy To Clipboard
1
2
3
4
5
6
7
8
9
10
11
: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
clip = new ZeroClipboard.Client();clip.setHandCursor( true );clip.glue("a-1");clip.setText(StripHTML(":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
"))
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 10 April, 2011, 17:33:36
Yeah, I just needed to show that the cursor doesn't change what is underneath it :)
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