Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Making My Text Adventure Smaller

Author
Message
ghostkrashers
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location:
Posted: 16th Jul 2011 08:58
So I'm working on using less lines (training myself for 20-line challenge ) and this is the smallest way I've found to make this text adventure. Can you guys compress it any smaller. Warning, its a little buggy when you "fail" ingame. Don't understand why.

Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 16th Jul 2011 14:56 Edited at: 16th Jul 2011 15:00
One line version :


I've also fixed your "bug" when you enter a number <> 1.

Samotnijat vylk nasred gorata.
-3D,2D Artist,Animator,Web developer and Programmer.
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 16th Jul 2011 14:59 Edited at: 16th Jul 2011 15:17
Edit, Gancheff beat me to it

Edit 2, upon review however I thought I should point out that $number is an integer not a string. So the dollar sign at the front isn't necessary.

ghostkrashers
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location:
Posted: 16th Jul 2011 20:13
Thanks for the help. Never knew about using ( . Its really helpful. Thanks!

And thanks about the $number/number thing. I was really just trying to make up a name for the string and I guess it didn't work out as planned
Webber
13
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 18th Jul 2011 23:47
I believe that the $ goes at the end of the string variable, that is if you need the variable to be a string. Or you can declare it as a string.

Well I simplified the code even more, using a backwards for loop.
I believe that the cause of the glitch, was an extra input command.

Here is the uncompressed version, I made.



This is the one line version.
I didn't add sync cause this isn't a graphic program.
And for some unknown reason the end command wasn't working, so I replaced it with the exit command.
It worked with the uncompressed code.



I doubt that it can be compressed much more then that.

I like games, and stuff.

Login to post a reply

Server time is: 2024-11-26 04:57:09
Your offset time is: 2024-11-26 04:57:09