PDA

View Full Version : Lib Generator Algothrim


robowurmz
16 Oct 2006, 18:18
I was wondering if anybody knew of how to go about making an algothrim for a random lib generator. I have an alpha version of the program, but I can't generate a random lib from a choice of 5 or 10. I can only make 1 work. Well, here's the alpha if you're willing to have a look. (download it) (http://www.deviantart.com/deviation/41500290/)

AndrewTaylor
17 Oct 2006, 11:10
Do you mind explaining what on Earth you're talking about?

robowurmz
17 Oct 2006, 12:33
A lib is a story where certain words are missing. Say like this:
Once upon a time there was a (adjective1) (creature1). This (adjective1) (creature1) used to like eating (food1). But one day, something (adjective2) happened, and he stopped eating (food1).

Like that, so the person playing with the lib might enter this:
Adjective1: smelly
Creature 1: worm
Food1: Hamburgers
Adjective 2: shiny

So it would become:
Once upon a time there was a smelly worm. This smelly worm used to like eating Hamburgers. But one day, something shiny happened, and he stopped eating Hamburgers.

I need a way to make a different main story each time from a selection of 5-10. I can't get more than one lib put into a multiple variable string.

Oh, and by the way, the language I'm using is DarkBASIC.

AndrewTaylor
17 Oct 2006, 13:38
Oh, right. I'm with you.

Without knowing what angle you've approached it fromso far it's hard to know what to suggest. I might have a lookat the demo later but I probably won'tbecause I'm quite busy. Too busy even to put all the spaces in this post.

Muzer
17 Oct 2006, 17:28
. .

robowurmz
17 Oct 2006, 19:30
Ooh. I don't think your computer can handle Direct3D. Are you using the latest DirectX? Are your drivers updated? Is it a good graphics card?

Edit: I have a new version now! Version 0.3...I'll put it up soon. It's in glorious two-tone blue!
(also on this, you have to press and hold spacebar to begin. It says that you just press it on-screen.)

Muzer
18 Oct 2006, 17:09
It is a crap computer with the latest DX
(crap=4mb video card)

Plasma
18 Oct 2006, 19:36
First, you do know that the code is "RND(numb)", right?

Ah, this takes me back to my QBASIC days...

robowurmz
19 Oct 2006, 10:23
Yeah, I know that, but I store the words the user types in as Strings, and I can't store each lib as a string, as the libs contain the strings needed. It won't let you put strings inside strings.
Here's an example:
`Store Words
INPUT "Adjective>>"; a$
.etc
`showing lib
PRINT "Once upon a time there was a ", a$, "person called dave."
Make this happen:
Once upon a time there was a (adjective) person called dave.

Now, if I do this:
b$ = "Once upon a time there was a ", a$, "person called dave."

I get an error, stating that equals demands no more than ONE variable array.

AndrewTaylor
19 Oct 2006, 13:41
Yeah, I know that, but I store the words the user types in as Strings, and I can't store each lib as a string, as the libs contain the strings needed. It won't let you put strings inside strings.
Here's an example:
`Store Words
INPUT "Adjective>>"; a$
.etc
`showing lib
PRINT "Once upon a time there was a ", a$, "person called dave."
Make this happen:
Once upon a time there was a (adjective) person called dave.

Now, if I do this:
b$ = "Once upon a time there was a ", a$, "person called dave."

I get an error, stating that equals demands no more than ONE variable array.
That error is (if, as I'm assuming DarkBASIC does this the same way PHP does) caused by the commas.

With the print statement you're passing three values to PRINT: two string constants (text in quotes) and one string variable (a$). You can't pass three values to b$. You want to join the strings. Probably you want to replace the commas with plus signs or full stops (I don't know the syntax for DarkBASIC -- in most languages it's +). That will pass one value made up from the other three.

You can do this with PRINT commands as well, and I consider it good practice to do so.