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.

Author
Message
midniteferret
15
Years of Service
User Offline
Joined: 14th Oct 2010
Location: where ever you are not
Posted: 14th Oct 2010 20:04
My code for a slot machine is not working... It works without the music but once I added it it stopped working please help Thanks!
[load music "media\mario theme.mp3", 1
set text font "Jokerman"
ink rgb(255,255,21),0
set text size 24
Print "Welcome to Free Slots where you win nor lose any money"
Repeat
Repeat
Play music 1
x=1
Input "Press one and enter to begin", Key
If x=key
right=1
Else
right=0
Print "Please press 1 and enter"
Endif
Until right=1
Randomize (Timer())
N1=RND (7)
Randomize (Timer())
N2=RND (6)
Randomize (Timer())
N3=RND (8)
Print "Below are your numbers"
Print N3, N2, N1
If N3=N2 and N2=N1
Win=2
Print "Jackpot!"
Endif
If N3=N2
Win=1
Print "Well done"
Endif
If N3=N1
Win=1
Print "Well done"
Endif
If N2=N1
Win=1
Print "Well done"
Endif
If Win=1 or Win=2
Print "Winner!"
Else
Print "FAIL"
Endif
Until Win=1 or Win=2
Print "the game is over"
y=1
Repeat
Input "press 1 and enter to quit", Key2
If Key2=y
quit=1
Else
quit=0
Print "Please press 1 and enter"
endif
Until quit=1
Print "Press any key to exit"
Wait Key]
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Oct 2010 22:05
Three things:
1-"Please Help!!" doesn't help anyone who's searching for a solution to a problem in the future...
2-Put code into code boxes by using the 'code' button before and after copying the code into the message box...
3-What error do you get? "Not working" could mean anything...

If you want helpful replies post information. I know it's hard when you first start, sorry if I sound harsh!

The only thing I can think is that maybe the mp3 file isn't where you are telling the program it is...

I really want to help, honest!

Nickydude
Retired Moderator
19
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 14th Oct 2010 23:45
Unhelpful Titles

Please do not simply write "Noob Question", "I am a newb", "One Noobie Question", "A question", "Please help", "This isn't working" or anything similar as the title of your post. We have a search facility, and meaningless titles do not help others find answers to their questions. It will also help you to get quicker responses if people have an idea of your thread content.



For KeithC
gbark
20
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 15th Oct 2010 06:07
I tried your code and it ran fine here (after substituting my own music file, of course). What exactly is not working in your program?

Could it be that your music file is too large and it's just taking a long time to load it on your machine? Did you try to see if it works with any other music files?

By the way, here's your code in actual code tags (with proper indentation )

SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 15th Oct 2010 06:52
Try your sound file as a .Wav instead of mp3
midniteferret
15
Years of Service
User Offline
Joined: 14th Oct 2010
Location: where ever you are not
Posted: 15th Oct 2010 22:57
Thanks, and sorry it is my first time posting

Login to post a reply

Server time is: 2026-07-22 12:41:47
Your offset time is: 2026-07-22 12:41:47