Qbasicnews.com
September 25, 2020, 08:51:52 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Random Dungeon Generator in 4 lines anyone?  (Read 8125 times)
BastetFurry
Forum Regular
**
Posts: 136



WWW
« on: February 10, 2005, 05:42:49 AM »

Hi!

Just as the topic says, a nice little 4liner that creates some kind of random dungeon.
With dungeon i mean those room+passage+room+... that most roguelikes (Nethack, Angband) create.
You dont need to populate it with monsters and treasures, just create it and
display it on a 80x25 text screen.

Lets see if i can come around with one too.

So Long, The Werelion!
Logged

color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #1 on: February 10, 2005, 05:48:16 AM »

4 liner without quotes? I guess without quotes, am I right? If you allow quotes I can stuff 200 lines in one Tongue
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
BastetFurry
Forum Regular
**
Posts: 136



WWW
« Reply #2 on: February 10, 2005, 06:34:53 AM »

Quote from: "na_th_an"
4 liner without quotes? I guess without quotes, am I right? If you allow quotes I can stuff 200 lines in one Tongue

With these -> :
And with the 255 char limit
Logged

color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Z!re
*/-\*
*****
Posts: 4599


« Reply #3 on: February 10, 2005, 07:40:15 AM »

Then it's a 1024character limit (Not counting CRLF)


Nath, quote = "
Colon (sp?) = : :lol:
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #4 on: February 10, 2005, 09:26:48 AM »

Gimme a break, I wrote that so early :lol:

If it is using colons... well, 1024 * 4 = 4 Kb of code. That's pretty big.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Z!re
*/-\*
*****
Posts: 4599


« Reply #5 on: February 10, 2005, 09:29:49 AM »

And if you don't use the QBIDE you can have over 1024byte lines...


Anyways, I have no idea how one would do this Cheesy
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #6 on: February 10, 2005, 09:37:42 AM »

Quote from: "Z!re"
And if you don't use the QBIDE you can have over 1024byte lines...


Anyways, I have no idea how one would do this Cheesy


Well, BC.EXE just takes 255 chars per line. The QB IDE can interpret programs with 1024 chars per line. When compiling, it adds funny "_"s.

(I think, I haven't coded in QB since...)
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Z!re
*/-\*
*****
Posts: 4599


« Reply #7 on: February 10, 2005, 09:48:43 AM »

Lol, i thought it was th other way around Tongue


Silly QB... freeBASIC all the way  Cheesy
Logged
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #8 on: February 10, 2005, 02:08:10 PM »

Define dungeon...
Logged

/post]
Z!re
*/-\*
*****
Posts: 4599


« Reply #9 on: February 10, 2005, 02:42:33 PM »

Quote from: "BastetFurry"
With dungeon i mean those room+passage+room+... that most roguelikes (Nethack, Angband) create.

Definiera: Läsa Tongue
Hehe :lol:
Logged
Oz
I hold this place together
*****
Posts: 923



« Reply #10 on: February 11, 2005, 09:05:45 PM »

what if they are 'ruins' of a dungeon, and some walls are broken down....lol - a large chaotic mass of walls

Oz~
Logged
Nixon
Member
*
Posts: 41



WWW
« Reply #11 on: February 19, 2005, 06:50:03 AM »

you are wrong about the line thing. You can have alot more the 255 or whatever ya said. Here is a link to a program made in qb 1.1 and is past the 255 and the 1000 mark and then goes back to 0 and continues on. you can use qb code and it will still work. Thats how I made a text adventure in 1 line, with 14 locations. The way ya do it is by puting the code under the code you want to make longer and then go to the start of the line and press backspace so that the second line joins to the end of the top line thus making the line longer.

www.geocities.com/sitenixon/LONG.BAS
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #12 on: February 19, 2005, 08:49:19 AM »

Yeah, but it is the compiler which doesn't take more than 256 chars. When you load that program in, say, PDS 7.1 and you hit on "Compile", the IDE splits the lines into 256 chars one using "_" and sends them to the compiler. Try compiling it from the command line: Call BC LONG.BAS /T/O/C:512 from the command line and see.

Code:
H:\>bc long.bas /t/o/c:512
Microsoft (R) QuickBASIC Compiler Version 4.50
(C) Copyright Microsoft Corporation 1982-1988.
All rights reserved.
Simultaneously published in the U.S. and Canada.
Object Filename [LONG.OBJ]:
Source Listing [NUL.LST]:
 0030   0006    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
lmnopqrstuvwxyzabcdefghijklmnopqrstuabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
uvwxyzabcdefghijklmnopqrstuvw



                               ^ Line too long
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!