Page 1 of 1
ZZT IS #TRYING it will move if it's not blocked
Posted: Fri Nov 18, 2005 8:11 pm
by Dr. Dos
otherwise it will proceed to the next line of code.
Posted: Sat Nov 19, 2005 6:52 pm
by Alexis Janson
This was one of the last commands I learned about in ZZT. I found out about it while editing Town of ZZT.
I don't know how I remember that but there you go
Posted: Sun Nov 20, 2005 7:27 am
by Quantum P.
Huh, it was one of my last commands, too. I was skipping through the built-in help file, and I had already read most of the ZZT-OOP Reference Manual; for the sake of completeness, I was just scanning the list for sections I hadn't read yet. #try was one of them.
I was so proud of myself once I learned #try because I now knew every documented ZZT-OOP command so im like an expert now and wow were there many commands i bet theres more commands than in qbasic and all the professional programmers use qbasic
i dont know why they still use qbasic they should switch to an advanced object oriented language like zzt-oop
seriously those microsoft guys should become zzt-oop experts like me
they can join my zzt company
Posted: Sun Nov 20, 2005 9:45 am
by MadTom
<BillGates> i won another madtom's pick for the company mr quantum sir!!
<Quantum_P> *puffs cuban cigar* well done, bill, well done. polish my boots.
Posted: Sun Nov 20, 2005 3:48 pm
by Ando
I think that ? can be used for #try as well. I learned that by editing Oof's "Special Adventure"!
Posted: Mon Nov 21, 2005 2:10 am
by wil
the thing that makes #try different and so special (and differetn from ?) is that if the #try fails, it will not go straight to the next line; instead, it will continue to execute code from that same line. This works for #take and #if, too.
?N will move north, unless blocked, then nothing.
#TRY N will do the same.
#TRY N GIVE GEMS 4 will attempt to move north; if it is blocked, it will instead give the player 4 gems.
#TRY N TAKE GEMS 4 SHOOT SEEK will move north, unless blocked, in which case it will take 4 gems; however, if the player has fewer than 4 gems, it will instead shoot seek.
#try n ?s#if blocked w /e#shoot seek will attempt a northward movement; otherwise, it will attempt to move south. Whether it succeeds or not, it will check if it is blocked to the west. If it is the case, it will move east. If it is blocked to the east it will try repeatedly to move east until it can do so. Once if has done so, it will shoot toward the player.
As you can see, these conditional statements can get quite long and complex. In run-on there are a couple times when i had to hex-edit to get all the conditionals to fit on one line! 60 characters is not long enough, by golly!
also, welcome to #try. now you can make video games.
Posted: Mon Nov 21, 2005 5:02 am
by Quantum P.
This is amazing.
First, Nadir creates a thread proclaiming ZZT's death.
Next, Dos creates a joke thread with a ZZT-OOP-related title.
Then people start talking about ZZT-OOP.
Finally, wil demonstrates some very cool coding tricks in ZZT.
Fear of the death of ZZT has caused this joke thread to be taken over by more active ZZT discussion than there is in the rest of ZZT General!
Posted: Mon Nov 21, 2005 5:20 am
by Ando
You have a point thaar.
Posted: Mon Nov 21, 2005 2:42 pm
by Zenith Nadir
i only started that thread because of jur's SHUT UP AND ZZT post on the zzt livejournal
Posted: Mon Nov 21, 2005 11:37 pm
by VinceP
good job, nadir. good job.