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 / Dinner program

Author
Message
glyvin101
19
Years of Service
User Offline
Joined: 27th Jan 2005
Location:
Posted: 3rd Jun 2005 07:54
Hi

My mom is always asking me what to cook for dinner and i never know what to tell here so she yells(alot) so i thought it would be cool to make a program that would randomize the main dish and the side i am having trouble with the RND command and getting it to rndmize some basic things

here is what i have





what is wroing?

THx

glyvin101
MeBiNiCi
19
Years of Service
User Offline
Joined: 2nd Jun 2005
Location: Cali
Posted: 3rd Jun 2005 08:17
Hello!

I am no expert, but I believe you need a funtion, so it outputs the randown variable string.

I hope I am correct, but then again I am a n00b.

Only in our dreams!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Jun 2005 08:23


The RND function will return a number from 0 to 2. Add 1, and that matches the array elements you've filled.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
glyvin101
19
Years of Service
User Offline
Joined: 27th Jan 2005
Location:
Posted: 3rd Jun 2005 08:34
THx i understand what you mean but it is only returning steak so why is this?

How do i fix it

THx

glyvin101
glyvin101
19
Years of Service
User Offline
Joined: 27th Jan 2005
Location:
Posted: 3rd Jun 2005 08:35
nvm fixed it randomize timer()
glyvin101
19
Years of Service
User Offline
Joined: 27th Jan 2005
Location:
Posted: 6th Jun 2005 14:31
ok i got

and it will not randomize them all properly why?

Thx

glyvin101
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 6th Jun 2005 15:01 Edited at: 6th Jun 2005 15:12
change:

(rnd(2)+7)

to

(rnd(8)+1)

Reason:
rnd(8) will return a number between 0-8
adding 1 makes the range from 1-9 (which is your valid ranges)

rnd(2) will return a number from 0-2
adding 7 makes the range from 7-9
(which would limit you to three possible outcomes)
7,8,or 9

======

I edited your app slightly to test it
-changed the spelling of spaghetti




seems to work fine.

edit:
Actually you only need to randomize the timer when the app is first launched. So you could have it like this





~zen

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 6th Jun 2005 16:12
www.allrecipies.com

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 7th Jun 2005 16:00
I'd write it like this.

Login to post a reply

Server time is: 2024-09-23 21:28:22
Your offset time is: 2024-09-23 21:28:22