Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Tal_Pal

Basic Slots Machine

Recommended Posts

it took me a while and the code I'm sure is VERY messy and there is probably a WAY better way to do it but still it works and I'm proud of myself :P

anyways this code acts as a basic slot machine. when you press a button (connected to the computer by redstone obveously), the machine spins and generates 3 pictures in a row and displays you loose when there isn't 3 in a row or Jackpot when you do have 3 in a row

 

for this to run you need a computer with a redstone card (or the redstone I/O will work i believe) with a lever connected to the BACK of the computer and your spin lever/button connected to the FRONT and a screen of some sort. preferably a big one so you can see the slots on screen easially enough

 

the lever connected to the back switches to the keyboard input so you can quit the program. also if there isn't a redstone input to the back, the spin lever/button will NOT work so you need that ON

 

once the lever in the back is on. you only have input from the spin lever/button meaning the keyboard will not work until that is switched off

 

in the keyboard imput, pressing ENTER will spin and pressing Q will close the program. if the lever is OFF and you want controll back to the spin lever/button then you need to switch the lever, connected to the back, back to ON then hit ENTER. that will spin once and return control back to the spin lever/button connected to the front

 

if you don't want the spin lever/button then you can keep the back redstone input OFF or remove it completely. then it's just ENTER to spin and Q to close the program

 

hopefully that made sense

 

its a looping program so if you leave your spin lever/button ON, the machine will constantly keep spinning. also it keeps looping to search for a change in redstone signal, but you don't notice that.

 

 

like I said, it's probably coded horribably but it works and hopefully there isn't a problem when it's tried someplace else like its an "only works for me" type of deal

 

http://pastebin.com/akUzwF4u

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.