Schrijver
| How do i create a loop using MSX BASIC?
|
[D-Tail]
 msx guru Berichten: 3019 | Geplaatst: 30 Maart 2006, 01:02   |
Talking about useless code obfuscation  |
|
AuroraMSX online
 msx master Berichten: 1260 | Geplaatst: 30 Maart 2006, 13:04   |
But it's faster than the IF/THEN/ELSE construct
[edit] (or is it?) [/edit] |
|
manuel msx guru Berichten: 3531 | Geplaatst: 31 Maart 2006, 14:45   |
It's also necessary for one-liners.  |
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 31 Maart 2006, 23:26   |
Nah, that is not obfuscation... how about this:
1 loop=5
2 ONERRORGOTO2:POKE-2373,0
3 loop=LO-1
4 ' Do all the fun things here.
5 if lollipop > mouth then we must be happy!
|
|
[D-Tail]
 msx guru Berichten: 3019 | Geplaatst: 02 April 2006, 11:14   |
NYYRIKKI: what's that poke actually doing?
|
|
BiFi msx guru Berichten: 3142 | Geplaatst: 02 April 2006, 16:49   |
LOL... nifty trick there again, NYYRIKKI.
[D-Tail]: [hint]convert that address to a 16-bit hexadecimal value and look it up in some system variables list[/hint]  |
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 02 April 2006, 19:03   |
That poke makes sure, that we are not in error handler to avoid error message.
BTW this code does not seem to work. It seems, that mouth is not big enough, so... to correct this problem, you must change mouth to head in line 5.  |
|
manuel msx guru Berichten: 3531 | Geplaatst: 02 April 2006, 22:23   |
What's the program supposed to do anyway? I doesn't do much here. With mouth it hangs (probably repeating errors) and with head it just finishes. That's probably the idea: it finishes while it has some utter crap in it  |
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 03 April 2006, 00:25   |
manuel: This is not a program. This is just one possible solution to question: "How do i create a loop using MSX BASIC?" Maybe not the most obvious one, but solution anyway...
|
|
|
|
|