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

Username:   Password: 
 RegisterRegister   
 Making all 3 reels on a slot machine display at image at the same time
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
asdfasdf123




PostPosted: Tue Jan 06, 2015 1:48 pm   Post subject: Making all 3 reels on a slot machine display at image at the same time

What is it you are trying to achieve?
Explained in the title.


What is the problem you are having?
I can only make the images appear one at a time.


Describe what you have tried to solve this problem
Looking up a way to do it.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


for i : 1 .. 10
                left := Rand.Int (1, 100)
                middle := Rand.Int (1, 100)
                right := Rand.Int (1, 100)
                if i not= 10 then
                    % Left reel
                    if left < 50 then
                        include "BarLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "BarLeftMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "BarLeftBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                    elsif left < 80 then
                        include "LemonLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "LemonLeftMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "LemonLeftBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                    elsif left < 99 then
                        include "PlumLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "PlumLeftMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "PlumLeftBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                    elsif left = 100 then
                        include "CherryLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "CherryLeftMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "CherryLeftBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                    end if
                    % Middle reel
                    if middle < 50 then
                        include "LemonMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "LemonMiddleMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "LemonMiddleBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                    elsif middle < 80 then
                        include "PlumMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "PlumMiddleMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "PlumMiddleBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                    elsif middle < 99 then
                        include "BarMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "BarMiddleMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "BarMiddleBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                    elsif middle = 100 then
                        include "CherryMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "CherryMiddleMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "CherryMiddleBottom.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                    end if
                    % Right reel
                    if right < 50 then
                        include "PlumRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "PlumRightMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "PlumRightBottom.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                    elsif right < 80 then
                        include "BarRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "BarRightMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "BarRightBottom.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                    elsif right < 99 then
                        include "LemonRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "LemonRightMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "LemonRightBottom.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                    elsif right = 100 then
                        include "CherryRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "CherryRightMiddle.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "CherryRightBottom.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                    end if
                    % Machine stops spinning
                elsif i = 10 then
                    % Left reel
                    if left < 50 then
                        left2 := 50
                        include "BarLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "BarLeftMiddle.t"
                    elsif left < 80 then
                        left2 := 80
                        include "LemonLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "LemonLeftMiddle.t"
                    elsif left < 99 or left = 99 then
                        left2 := 99
                        include "PlumLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "PlumLeftMiddle.t"
                    elsif left = 100 then
                        left2 := 100
                        include "CherryLeftTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 150, CENTREY - 70, CENTREX - 60, CENTREY + 70, white)
                        include "CherryLeftMiddle.t"
                    end if
                    % Middle reel
                    if middle < 50 then
                        middle2 := 80
                        include "LemonMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "LemonMiddleMiddle.t"
                    elsif middle < 80 then
                        middle2 := 99
                        include "PlumMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "PlumMiddleMiddle.t"
                    elsif middle < 99 or middle = 99 then
                        middle2 := 50
                        include "BarMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "BarMiddleMiddle.t"
                    elsif middle = 100 then
                        middle2 := 100
                        include "CherryMiddleTop.t"
                        delay (50)
                        drawfillbox (CENTREX - 40, CENTREY - 70, CENTREX + 40, CENTREY + 70, white)
                        include "CherryMiddleMiddle.t"
                    end if
                    % Right reel
                    if right < 50 then
                        right2 := 99
                        include "PlumRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "PlumRightMiddle.t"
                    elsif right < 80 then
                        right2 := 50
                        include "BarRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "BarRightMiddle.t"
                    elsif right < 99 or right = 99 then
                        right2 := 80
                        include "LemonRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "LemonRightMiddle.t"
                    elsif right = 100 then
                        right2 := 100
                        include "CherryRightTop.t"
                        delay (50)
                        drawfillbox (CENTREX + 60, CENTREY - 70, CENTREX + 150, CENTREY + 70, white)
                        include "CherryRightMiddle.t"
                    end if
                end if
            end for % Spinning ends



Please specify what version of Turing you are using
4.1 1.0.1



documents-export-2014-12-12.zip
 Description:
If you want to see the whole thing, download this (the file is 1SlotMachine.t, but you have to run it through 1MainMenu.t)

Download
 Filename:  documents-export-2014-12-12.zip
 Filesize:  2.2 MB
 Downloaded:  95 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: