Jul 9, 2008

Ti-basic --- Slot Machine

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

free web hosting

Ti-basic --- Slot Machine

KansukeKojima
Description

Ok, so this is my first TI-BASIC tutorial. In this tutorial you will learn how to create a very simple slot machine, so you can entertain yourself in math class tongue.gif You will need at least a TI 83 Calculator.

Try it out

Ok, first create a new program called 'SLOT MACHINE'. Hit the enter key.

Now input the following code.

CODE
:ClrHome
:Lbl 1
:Output(1,1,"--Slot Machine--")
:Output(2,1,randInt(0,9,1))
:Output(2,4,randInt(0,9,1))
:Output(2,7,randInt(0,9,1))
:Goto 1


**EDIT** (Sorry, I didn't have enough time to finish this yesterday)

Ok, now exit the program editing screen, and run the program.

You have created your first TI-Basic slot machine! You may be wondering how to stop the slots. Simply hit the 'On' button while the program is running. It will force the program to error. It will ask you to quit, do it. After you quit, you will see whatever numbers you stopped the slot machine on. To run it again, simply hit enter.

 

 

 


Reply

coolcat50
Very nice Kansuke, I advise though using a better form of stopping it. Also, labels suck in Ti-BASIC. They can cause the calculator to output an error message.

Here is a little better version of the code.
CODE
:ClrHome
:A=0
:While(A=0)
:getKey -> K
:Output(1,1,"--Slot Machine--")
:Output(2,1,randInt(0,9,1))
:Output(2,4,randInt(0,9,1))
:Output(2,7,randInt(0,9,1))
:If K=105:Stop
:End


EDIT: Fixed Output statements

Reply

KansukeKojima
Thanks man! I wasn't quite sure how to use the Enter Key to get it to stop... I kind of just figured out how to do this by messing around with stuff and learning how to use the output command XD

Reply

coolcat50
No problem! You use getKey to retrieve a key value and you compare the key value from getKey with a key value of a certain button using an if statement. I've made a few neat games using getKey and the Graph.

Reply

ShaggytheClown
Nice Ti-basic --- Slot Machine tutorial Kansuke

Reply

KansukeKojima
Hello again everyone. In my recent math classes, I've been able to improve my slot machine.
It now includes:
1. A coin counter

So if you want this on your TI calculator, then copy this code:

CODE
:ClrHome
:If Z=-1:10->Z
:0->A
:0->K
:Output(6,1,"COINS:")
:Output(7,1,Z)
:Output(1,1,"--SLOT MACHINE--")
:Output(5,1,"----------------")
:While (A=0)
:getKey->K
:Output(3,4,randInt(0,9,1))
:Output(3,7,randInt(0,9,1))
:Output(3,10,randInt(0,9,1))
:If K=105:Z-1->Z
:If Z=-1:Output(6,1,"PLAY AGAIN?"
:If K=105:Stop
:End


All this modification does: you start the game with ten coins, every time you play, you lose a coin. Once the coins reach zero, you are asked to play again. If you hit enter, you'll get ten new coins to play with.

Also, if anyone knows how to do this, could you please modify this so that you will win coins when you get three numbers in a row?

 

 

 


Reply

iGuest
Replying to KansukeKojima

I MAY BE ABLE TO HELP, BUT YOU HAVE TO TELL ME WHAT EACH VARIABLE MEANS

-reply by RANDOM

Reply

KansukeKojima
Hello Again everyone! I have finally perfected the slot machine! It now gives you more coins when:
1. You get three of the same number in a row (example: 1,1,1)
2. You get a series of numbers in a row. (example: 1,2,3)
3. You get two of the same numbers. (example: 1,1,2)
4. You get two numbers that add up to the other (example: 5,2,7 (5+2=7))

Anyways, just type this into the program mode on your calculator and you should be able to play.

CODE
:ClrHome
:If D=E and E=F:Z+10->Z
:If D=E or E=F or D=F:Z+2->Z
:If F=E+1 and E=D+1:Z+2->Z
:If F=D+E or E=D+F or D=E+F:Z+2->Z
:If Z=-1:10->Z
:0->A
:0->K
:Output(6,1,"COINS:")
:Output(7,1,Z)
:Output(1,1,"--SLOT MACHINE--")
:Output(5,1,"----------------")
:While (A=0)
:getKey->K
:randInt(0,9)->D
:randInt(0,9)->E
:randInt(0,9)->F
:Output(3,7,D)
:Output(3,10,E)
:Output(3,10,F)
:If K=105:Z-1->Z
:If Z=-1:Output(6,1,"PLAY AGAIN?")
:If K=105:Stop
:End


That should work, if it does not, then please post in response saying so, and I will try to fix it.

If your coin count ever gets to high just type in 10->Z to reset how much your coins are worth.

Enjoy.

Reply

seba1killer
Very good, i have never used that Basic. I started learning with your tutorial and probably i will continue in my own.
Thanks and regards

Reply

hitmanblood
hoho TI basics I haven't made program in that language in long time. I remember writing Horner's algorithm so that it would solve me for any power of equation and simple stuff like solvers for the quadratic equation and so on. Just to make my life easier.

But one thing I wanted to say. If you are writing tutorial Kanasuke then you should try to explain what everything means and represents because when noob comes here without any pre knowledge then he wouldn't figure out anything.

Also try to add some graphics to the game they are always more appealing.

Best Regards

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. how to make a basic slot machine - 14.02 hr back.
  2. php slot machine code - 20.24 hr back.
  3. slot machine java tutorial - 36.64 hr back.
  4. hotspot loginin vb6 - 67.89 hr back.
  5. slot machine in visual basic - 92.35 hr back.
  6. building a slot machine php - 128.60 hr back.
  7. visual basic slot machine - 192.58 hr back.
Similar Topics

Keywords : ti, basic, slot, machine

  1. Basic Of Website Creation
    Get basic knowledge on website creation here (0)
  2. Buliding A Basic Community Site
    Building Community With Joomla (2)
    Hi I am currently running a Joomla CMS webpage, and Google Adsense on my page has generated a
    reasonable sum. I have used Joomla to build this webpage at the grounding and now with all the
    extension, it has become a money making webpage. I encourage all to try out this great CMS system.
    Here are some extentions I would reccomend. CB Bulider. Expose 4, Jambook, Ako Comment. Cheers.....
  3. A Twist On Basic Authentification
    html help (1)
    Alright, i am working on a website where a number of different users from different companies will
    be looking hooking into one website. What i want is to know how i can differentiate between the
    users based on the information passed by the webserver. I've been told to that information
    will be passed along html_user(and if i have a distinct user then i can just query the database with
    that info and get what i want) But how does this work? I am sorry i know this is cryptic i'm
    kind of searching to see if this strikes a bell with anyone. So to sum, many user....
  4. Windows Vista License Transfer?
    Use on a seperate machine than it came with? (7)
    Well I have been thinking about building a new gaming rig pretty soon and I will be able to spend a
    bit more than usual because I already have the essentials( Mouse, Keyboard, Printer, Monitor) but I
    have a questions about Vista. I have a nice HP dv9000 laptop that I have had for a couple months
    that came with Windows Vista Home Premium. Now what I want to know is there anyway that I can
    somehow get that onto a new machine I build as long as I take it off the laptop? I mean I bought the
    laptop and if it comes with Vista, or any OS for that matter, I am purchasing the li....
  5. Site Back Online, But....
    Works on anyone's machine but mine. (20)
    I got a reply from Xisto today that my site was up and running again. Yet, when I surf to it, it
    will not load, also, my email client keeps telling me the POP3 server (the one related to my domain)
    timed out. My Cpanel will not open neither. On my son's laptop (on the same network, hence same
    IP address) the site loads immediately. Has anyone got any idea what the problem my end could be?
    Thanks.....
  6. Ti Basic: Pick A Number
    (1)
    Description Learn how to create a neat-o Game in TI Basic. Its basic premise is that someone
    picks a number, then they pass the calculator to their friend, and they try to guess the number.
    Once the successfully guess the number a message appears and says that they have won. I have also
    included a line that keeps users from choosing numbers greater than one-hundred. Please Enjoy.
    Try I Out Alright.... just input what you see below and I'll explain it a little below.
    CODE :ClrHome :Lbl 2 :Prompt A :A->X :If X>100 :Goto 2 &#....
  7. Aob Blood Grouping
    Few Basic Idea for all (0)
    AOB blood grouping is the most common blood grouping in present world. In this grouping blood
    grouped depending on presence and absence of antigen A and antigen B in blood. Blood groups in AOB
    system are A, B, AB and O. I am trying to explain this blood grouping system as easy as possible so
    that the member of this site who has no science background can also understand the system. If any
    blood contain antigen A but no antigen B, the blood group will be A blood group. If any blood
    contains antigen B but no antigen A, the blood group will be B blood group. If any blood co....
  8. Acessing Files In Mac Os X
    How to access your files from a different machine? (0)
    I have a mac book pro and an imac at home. I have accounts of user 'sone' on both machines
    and I scan most of my on the imac and it gets saved automatically in my home/pictures folder. I know
    its not shared by default here but is there any way I can be able to mount that folder or even give
    access to myself from my macbook pro to it? It would save a lot of tedious steps to share it other
    wise i.e copying it to another shared folder. Any information much appreciated thank you. ***** OK
    never mind I just learned I can do it easily enough. OS X already provided ac....
  9. Some Basic But Important Info About Cancer
    (3)
    Symptoms of Cancer 1. Lumps, especially those that are growing larger gradually, appearing on parts
    of your body such as the breasts, neck abdomen. 2. Signs of injury not externally inflicted which
    do not go away after a long time, such as bruises and scratches on the skin or ulcers on the tongue
    3. Body weight keeps fluctuating or nutrition level decreases dramatically (e.g. falling sick more
    frequently or feel tired easily) despite the absence of sicknesses that also cause such symptoms
    such as Diabetes. 4. Dry cough that does not heal in a long while, blood in phl....
  10. Photoshop Tut: Basic Text (video)
    (0)
    Same thing as my sig tut, but for text. http://youtube.com/watch?v=SDFfVDSBhrY ....
  11. Photoshop Tut: Basic Sig (video)
    (0)
    This tutorial is for BEGINNERS who want to make a basic signature. And yeah I know, I have a weird
    squeaky voice :3 http://youtube.com/watch?v=9HE0C15uP80 ....
  12. Ftp In Visual Basic 6.0
    Start making your FTP client using VB6 (0)
    Recently, I had a need to make a FTP client, since our webhosting FTP server was kind of exotic, and
    very restrictive, and most of uploads, even though they reach 100% would crash... File would be
    uploaded to a server, but FTP clients just froze upon completion, waiting for the 226 (OK) from FTP
    server... So, I had to make my own, one who would not wait for 226, but instead, watch the file
    pload progress... This tutorial is not fuly complete, in the sense that it does not offer COMPLETE
    FTP client functionality (for example, I ddn't write the code for FTP download, ....
  13. Java Updates On My Machine
    I have several versions (3)
    As per the following image, I have several java updates stored on my machine, and I wondered if the
    older ones could be deleted and have the java runtime perform okay? I'm simply trying to
    clean out a bunch of junk on my machine... make some HDD space.....
  14. Two Really Good 2d Mmo Engines
    One is pretty basic, the other one is for top notch programmers. (1)
    AlterEngine MMO engine that lets you edit and create a new world. Just run the server and
    distribute the game client, it's simple to use and effective for non commercial MMOs. It's
    mother language is spanish, so unless you know spanish, I wouldn't recommend this. This Engine
    doesn't require much Programming Experience. vbGORE Great MMO Engine, very powerful. Runs
    with VB6, fully editable. It's free and open source. It can achieve great things if you have the
    time and potential to script neat VB6 functions with Packet related coding and knowledg....
  15. Help! Php Or Just Html?
    i want to start buliding my website. which is better, php or basic htm (13)
    i try to start this topic in webhost category but it seems like i cant. i dont have the permission
    so i just post my topic here. im sorry mod.. i want to build a website which contains: - Links to
    videos - Informations - photos - flash i don't know if i should use php or just HTML. guys,
    what are your opinions..??....
  16. Mysql In Visual Basic
    Mysql in visual basic (5)
    I'm am trying to create a script so that visual basic 6 can interact with mysql Any ideas?....
  17. Learn Russian
    Basic Stuff You Need To Know (7)
    Learning Russia Lesson 1 - Basic Words ~~~~~~ Hello - privyet (informal hello) Hello - zdrastye
    (formal hello) Bye - poka How are you - kak dila Good/Wll - horosho Ok/Normal - normalno Poor/Bad -
    Ploka ---More Words Yet To Come--- ---Study Makes Perfect--- I am going to make a quiz over this
    so you all better be ready =). I hope I inspire you to learn russian. Its a great language plus I am
    russian as a russian respects mother russia we respect all so I am sharing top language (not really
    top) to you. L = Lesson Quiz - Over L1 http://www.quizyourfriends.com/quizp....
  18. Hotspot Virtual Machine Exception_access_violation
    conflict between Sun Java and Windows (4)
    i was just messing around as usual on the net, and when i was closing everything down, i noticed
    this file on my desktop 'hs_err_pid3672' its a text file, i have no idea what it is and cant
    understand anything in it, but its kinda freakin me out, so i would appreciate anything you guys
    have to say about it CODE # # An unexpected error has been detected by HotSpot Virtual
    Machine: # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9010f3, pid=3672,
    tid=1928 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, shar....
  19. Creating A Timer Program
    Using Visual Basic 2005 (8)
    This tutorial will explain how to create a basic timer using Visual Basic Express 2005. If you
    don't have it, it's free and you can dowload it from Microsoft's website. All you need
    is a few minutes to sit down and read this and a version of Visual Basic. OK, so what will this
    timer actually do? Well, you are able to enter a number of minutes and a message, and then click a
    button. Once the timer is up, your message pops up and you are reminded! So, basically it's
    a little reminder system. I use it to remind me when TV programmes start, when I have to....
  20. Simple C File Handling In Action
    Small code snipet which covers most of basic file handling and navigat (2)
    Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
    formalities to get the code review incorporated and update all source code files with code review
    headers. Imagine if you need to open 300 files one by one and append code review headers at the
    end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
    in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
    utility to open all files passed on command line and open attach code review headers an....
  21. My First C++ Program
    very basic (6)
    Okay, well today I've started learning C++ and after about 30 minutes I've managed to
    compile my first program /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> All it does is prompt you to type a number in between 1 and 10. If it's not
    in that range, it adds/subtracts until it is. The best part is you get to see it add/subtract the
    numbers up one-by-one! Code: #include using namespace std; int main() {
    // Define variables int anumber; cout cin>> anumber; cin.ignore....
  22. What Is Google Cash Machine?
    (7)
    I have heard and got so many advertisements about this thing and I decided as there are so many of
    you using using google adsense you must be knowing what all the fuss is about. so before asking I
    did a lilttle google search and got a vague idea of what this is because all I get is advertisments
    linking me to eBooks telling me how to use the system without telling what it is really about. So
    from what I recall this has got to do something with affiliate programming and that is it. so what I
    am thinking is are you going to advertise your link on google sponsered links an....
  23. How To Make A Web Browser
    Visual Basic 6 (48)
    This is a simple and specific tutorial on how to make a basic web browser in Visual Basic 6. Steps
    1-3 Create a new project, and then go to "Project" on the menu. Click components as shown in the
    following image. Find the component "Microsoft Internet Controls," check it, and click "Apply" and
    then "Close." Click the icon that was just added in the tools window, and draw a large sized
    window with it. This is going to be where you view webpages through your browser, so don't make
    it small, but leave room for buttons and other accessories. Steps 4-6 Make a t....
  24. Visual Basic 6.0 Help Needed
    Adding lines to a textbox without delete (13)
    I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
    lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
    Help is appreciated!....
  25. Java Basic Program Guidance
    (6)
    aving some problems taking in the Java at Uni, Was wondering if anyone could shine some light on it
    for me. My task is to write a program that will ask you to enter 2 words. the program will then
    print out both words on one line. However the words will be seperated by dots that will make the
    total length of the line 40. so if your first word was turtle and the second was abc, the output
    would be turtle...............................abc The program should check for certain conditions:
    1. a word can not be longer than 37 characters; 2. there must always be atlest 2 do....
  26. Simple Login In Visual Basic 6
    user interaction example trough login programm (5)
    First of all, I am NOT a programmer, this is something my friend taught me. It describes basic
    interaction with the user, while showing basic functionality of this simple programm. So, without
    further ado, we're off to the tutorial: First of all, start your visual basic, when prompted
    for new project, select Standard Exe . Next, we need to open code window, so we can start typing
    the program. This can be done in two ways, one is double clicking on the form, or selecting Code
    from View menu. If you double clicked on the form, you will see following text: CODE ....
  27. Game machine or PC?
    (19)
    What do you use? Tell us about it: Me: PC Athy 2400+ 256MB Ram 80GB Seagate HD GBA
    NES....
  28. [tutorial] Visual Basic 6 Minimize To Tray
    Minimize to Tray (4)
    This example will "minimize" your program to the system tray when you click on a button, and restore
    it when you click the system tray icon. For this example you'll need: 1 Form - Form1 1 button -
    Command1 Add a Module to your project, and ad this code: CODE ' Create an Icon in System
    Tray Needs Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long
    uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Public Const NIM_ADD = &H0
    Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const WM_MOUSEMOVE ....
  29. [tutorial] Visual Basic 6
    Closing Programs Right, Why END is bad (2)
    This tutorial applies to all those people who insist upon using "End" to close their programs: End
    stops the program immediately without any thought as to what's going on - it's like a high
    speed train hitting a brick wall. It can cause unwanted errors and is bad programming practice in
    general. END gets rids of the form, but NOT its leftovers. This leaves a bunch of memory that will
    still be in use even after your program has supposedly closed. An object or variable won't be
    terminated properly - it's just not a graceful exit. The only time that it'....
  30. Need Help With My Python Programs
    just extremely basic stuff (11)
    ok, i am learning python, and i realy dont know much. my guide im using said to make a program
    where it asks your name, and if the name is yours your make it so there is a compliment, if it is
    another name you make it that its an insult, and anything else makes it say Nice name. here is what
    i wrote name = raw_input("What is your name?") if name == John: print "Your name is freaking
    sweet, you must be a god or something." elif name == Bob: print "You have a freakin' weird
    name, dude." else: print "Nice name,",name i donot understand what i am doing w....

    1. Looking for ti, basic, slot, machine

Searching Video's for ti, basic, slot, machine
Similar
Basic Of
Website
Creation -
Get basic
knowledge on
website
creation
here
Buliding A
Basic
Community
Site -
Building
Community
With Joomla
A Twist On
Basic
Authentifica
tion - html
help
Windows
Vista
License
Transfer? -
Use on a
seperate
machine than
it came
with?
Site Back
Online,
But.... -
Works on
anyone's
machine but
mine.
Ti Basic:
Pick A
Number
Aob Blood
Grouping -
Few Basic
Idea for all
Acessing
Files In Mac
Os X - How
to access
your files
from a
different
machine?
Some Basic
But
Important
Info About
Cancer
Photoshop
Tut: Basic
Text (video)
Photoshop
Tut: Basic
Sig (video)
Ftp In
Visual Basic
6.0 - Start
making your
FTP client
using VB6
Java Updates
On My
Machine - I
have several
versions
Two Really
Good 2d Mmo
Engines -
One is
pretty
basic, the
other one is
for top
notch
programmers.
Help!
Php Or Just
Html? - i
want to
start
buliding my
website.
which is
better, php
or basic htm
Mysql In
Visual Basic
- Mysql in
visual basic
Learn
Russian -
Basic Stuff
You Need To
Know
Hotspot
Virtual
Machine
Exception_ac
cess_violati
on -
conflict
between Sun
Java and
Windows
Creating A
Timer
Program -
Using Visual
Basic 2005
Simple C
File
Handling In
Action -
Small code
snipet which
covers most
of basic
file
handling and
navigat
My First C++
Program -
very basic
What Is
Google Cash
Machine?
How To Make
A Web
Browser -
Visual Basic
6
Visual Basic
6.0 Help
Needed -
Adding lines
to a textbox
without
delete
Java Basic
Program
Guidance
Simple Login
In Visual
Basic 6 -
user
interaction
example
trough login
programm
Game machine
or PC?
[tutorial]
Visual Basic
6 Minimize
To Tray -
Minimize to
Tray
[tutorial]
Visual Basic
6 - Closing
Programs
Right, Why
END is bad
Need Help
With My
Python
Programs -
just
extremely
basic stuff
advertisement



Ti-basic --- Slot Machine



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE