Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 SLOTS error
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bc123




PostPosted: Tue Dec 01, 2009 3:33 pm   Post subject: SLOTS error

What is it you are trying to achieve?
Im trying to make a fully working slots game (simple way with 3 in row not 9 images)


What is the problem you are having?
where im inputing images [eg. cherry] i dont have images in yet but i made a slot machise design and it takes away the rest of the line when i use locate


Describe what you have tried to solve this problem
using a text file but i dont kno how to fix the thing where you cant put spaces in txt file cuz it skips to next line instead of reading whole line


Post any relevant code

Turing:


var wheel1 : int
var wheel2 : int
var wheel3 : int
var quarter :  real := 0.25
var looney : real := 1.00
var tooney : real := 2.00
var wheeltotal : int
var money : real := 0
var moneyinput : int
setscreen ("graphics:max;max")
color (10)
colorback (black)
cls
put "Welcome to CASINO ROYALE, you are using a slot machine."
delay (2000)
loop
locate (1,1)
put "INSERT COIN [1]Quarter [2]Looney [3]Tooney]"
get moneyinput
if moneyinput = 1 then put "alright 25 cents"
money := money + quarter
elsif moneyinput = 2 then put "alright 1 dollar"
money := money + looney
elsif moneyinput = 3 then put "alright 2 dollars"
money := money + tooney
else put "Error"
end if
put "                                                                                                 "
put "                                                                                                 "
put"                                                    _________.____    ____________________________"
put"                                                   /   _____/|    |   \\_____  \\__    ___/   _____/"
put"                                                   \\_____  \\ |    |    /   |   \\|    |  \\_____  \\ "
put"                                                   /        \\|    |___/    |    \\    |  /        \\"
put"                                                  /_______  /|_______ \\_______  /____| /_______  /"
put"                                                          \\/         \\/       \\/               \\/ "
put"______________________________________________________________________________________________________________________________"
put"===================================================================================================================(    )====="
put"==================================================================================================================(      )===="
put"===================               ======================               =====================               ======(        )==="
put"===================               ======================               =====================               =======(      )===="
put"===================               ======================               =====================               ========(    )====="
put"===================               ======================               =====================               =========(  )======"
put"=================I=               =I==================I=               =I=================I=               =I=======(  )======"
put"====I============I=               =I==================I=               =I=================I=               =I=======(  )======"
put"====I============I=               =I==================I=               =I=================I=               =I=======(  )======"
put"====I============I=               =I==================I=               =I=================I=               =I=======(  )======"
put"====I============IIIIIIIIIIIIIIIIIII==================IIIIIIIIIIIIIIIIIII=================IIIIIIIIIIIIIIIIIII=======(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I===============================================================================================================(  )======"
put"====I=========================================================================================== insert coin below =(  )======"
put"====I===============================================================================================================(  )======"
put"====I=============================================================================================               ============="
put"=============================================================================================================================="
put"\\===========================================================================================================================/"
put" \\=========================================================================================================================/"
put\\=======================================================================================================================/"
put"   \\=====================================================================================================================/"
put"    \\===================================================================================================================/"
put"     \\=================================================================================================================/"
put"      \\===============================================================================================================/"
put"       \\=============================================================================================================/"
put"        \\===========================================================================================================/"
put"         \\=========================================================================================================/"
put"          \\_______________________________________________________________________________________________________/"

wheel1 := Rand.Int (1, 6)
wheel2 := Rand.Int (1, 6)
wheel3 := Rand.Int (1, 6)
delay (1000)
locate (13,24)
if wheel1 = 1 then put "cherry     ======================"
elsif wheel1 = 2 then put "apple      ======================"
elsif wheel1 = 3 then put "banana     ======================"
elsif wheel1 = 4 then put "777        ======================"
elsif wheel1 = 5 then put "cheese     ======================"
elsif wheel1 = 6 then put "orange     ======================"
end if
delay (1000)
locate (13,61)
if wheel2 = 1 then put "cherry     ====================="
elsif wheel2 = 2 then put "apple      ====================="
elsif wheel2 = 3 then put "banana     ====================="
elsif wheel2 = 4 then put "777        ====================="
elsif wheel2 = 5 then put "cheese     ====================="
elsif wheel2 = 6 then put "orange     ====================="
end if
delay (1000)
locate (13,98)
if wheel3 = 1 then put "cherry     =================="
elsif wheel3 = 2 then put "apple     ==================="
elsif wheel3 = 3 then put "banana     =================="
elsif wheel3 = 4 then put "777        =================="
elsif wheel3 = 5 then put "cheese     =================="
elsif wheel3 = 6 then put "orange    ==================="
end if
if wheel1 = wheel2 or wheel1 = wheel3 or wheel2 = wheel1 or wheel3 = wheel2 or wheel3 = wheel2
then
locate (1,1)
 put "WINNER"
end if
delay (5000)
end loop




[size=14][b]Please specify what version of Turing you are using

im using 4.1.1
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Tue Dec 01, 2009 3:53 pm   Post subject: RE:SLOTS error

To read a whole line, including spaces, use :* at the end of your get line, as follows:

Turing:

get string_variable : *


Each time you use put, it replaces the entire line of text it outputs to. There is, to my knowledge, no way to change that behaviour. In general, one would try to use only images (Pic, Draw and Font modules) or only text (locate, put, Text module) at any given time.
Zren




PostPosted: Tue Dec 01, 2009 3:55 pm   Post subject: RE:SLOTS error

get thingy :*
The :* will include the whitespace.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: