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

Username:   Password: 
 RegisterRegister   
 How do you.... (I'm a newbie)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mikeevd




PostPosted: Thu Apr 28, 2005 9:44 pm   Post subject: How do you.... (I'm a newbie)

I just began using turing and I'm getting a hang of the basics but I don't really know how to do any of the more advanced things even after reading the manual over. So if anyone could help me with the following:

What's the code for making the screen pretty much all black and having a countdown in large font in the middle...and then it breaks off onto the next part of the program after it hits "1". I have no idea how to make this flow and I have no idea how to make the countdown thing at all, I've seen it before and am interested in seeing how it works...

Thanks in advance...
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Thu Apr 28, 2005 9:54 pm   Post subject: (No subject)

you could try the
code:
colorback(black)
cls

at the beginning of your program to make it fill the background black ... then look up
code:
Draw.Text
in the F10 manual

hope this helps
-Compwiz
Mikeevd




PostPosted: Thu Apr 28, 2005 10:29 pm   Post subject: (No subject)

Well I'm not at the computer with Turing on it yet so until I am and see what you said, more replies would be useful just incase Smile

Thanks!
[Gandalf]




PostPosted: Thu Apr 28, 2005 10:44 pm   Post subject: (No subject)

You might also want to look up delay(number) and for loops (or just loops in general).

Here is a small example.

code:

for i : 1 .. 10
put i
delay(1000)
end for
cls
put "countdown complete"
Mikeevd




PostPosted: Fri Apr 29, 2005 1:11 pm   Post subject: (No subject)

I looked up everything and understand how what you did works but how do I make each number as the countdown goes centered on it's an empty black screen...

I'm trying to make an empty black screen with large green font in the middle counting down from 10 to 1 but not showing any of the previous numbers like this:

10
9
8
7

...I'm not even sure how to make the count go down like that...only works 1 to 10 for me.

Sorry for all the questions...thanks again.
Mikeevd




PostPosted: Fri Apr 29, 2005 1:15 pm   Post subject: (No subject)

I just realized my dumbness...I can just put:

code:
put "10"
delay (1000)
cls
put "9"



etc...
1of42




PostPosted: Fri Apr 29, 2005 3:35 pm   Post subject: (No subject)

A much better way:

code:

colorback (black)
cls

for decreasing i : 10 .. 1
   put i
   delay (1000)
end for
hacker101




PostPosted: Fri May 06, 2005 8:39 pm   Post subject: Help

Just uses drawfillbox or you can use setscreen.

To draw big text use Font Draw command


code:

drawfillbox (1,1,640,400,16)
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat May 07, 2005 7:26 am   Post subject: (No subject)

Turing:

View.Set ("offscreenonly")
colourback (black)
cls

var font := Font.New ("Impact:72")

for decreasing i : 10 .. 1
    for rep : 1 .. 2
        for c : 1 .. 255
            if rep = 1 then
                RGB.SetColour (200, 0, 255 - c, 0)
            else
                RGB.SetColour (200, 0, c, 0)
            end if
            cls
            Font.Draw (intstr (i), round (maxx / 2 - Font.Width (intstr (i), font) / 2), round (maxy / 2 - 72 / 2), font, 200)
            View.Update
            delay (1)
        end for
    end for
    delay (400)
    cls
end for
syphon4




PostPosted: Fri Jun 03, 2005 7:25 pm   Post subject: countdown

heres something probaby at your level that you will understand...

var Counter : int := 10

drawfillbox (0, 0, maxx, maxy, 7)
colourback (black)
colour (green)

loop
put " " : 40, Counter
exit when Counter = 1
Counter := Counter - 1
end loop
Cervantes




PostPosted: Fri Jun 03, 2005 7:39 pm   Post subject: (No subject)

1.)
Resurrecting old topics is not cool. The author has already got the help he needed.
2.)
Please use [ code][ /code] tags when posting code.
3.)
It's much nicer to use a for loop that does the counting for you than a conditional loop that incriments a counter.
4.)
The colourback (black) line is useless. colourback only does anything when cls is called. Either do the drawfillbox, or colourback & cls.
5.)
Instead of doing put : 40, Counter, you could use locate().
6.)
According to convention, classes start with capital letters; variables do not. (correct?)
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  [ 11 Posts ]
Jump to:   


Style:  
Search: