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

Username:   Password: 
 RegisterRegister   
 My Matrix Procject
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AlexIbrahim




PostPosted: Thu Jun 03, 2004 9:25 am   Post subject: My Matrix Procject

My question is how Do I make it so when the user clicks on thr Blue pill , it does one thing and if they click on the Red pill it does something. We haven't learnt how to do that yet Very Happy

heres the code

var font1, font2,font3 : int
colourback (7)
cls
font1 := Font.New ("Impact:72")
font2 := Font.New ("Times New Roman:20:bold")
font3 := Font.New ("Times New Roman:15:bold")
assert font1 > 0
%for c : 1 .. 1000
var letter : string

var row, col, colour_, character : int
var characters : string := "0 1"
var continue : string (1)
var font : int
var Counter : int
var Delay : int
colourback (7)
Delay := 400

Font.Draw ("You will now be given the choice of two pills", 50, 200, font3, 0)
Font.Draw ("The Red pill will give you back your normal life ...", 50, 220, font3, 0)
Font.Draw ("The blue pill will let you know the real world ..The Matrix", 50, 240, font3, 0)
Font.Draw ("Press B for Blue Pill , Press R for Red Pill", 50, 260, font3, 0)
%Blue
Font.Draw ("B", 80, 150, font2, 32)
delay (Delay)
Font.Draw ("L", 100, 150, font2, 32)
delay (Delay)
Font.Draw ("U", 120, 150, font2, 32)
delay (Delay)
Font.Draw ("E", 140, 150, font2, 32)
drawfilloval (120,70,20,30,32)
%Red
Font.Draw ("R", 460, 150, font2, 4)
delay (Delay)
Font.Draw ("E", 480, 150, font2, 4)
delay (Delay)
Font.Draw ("D", 500, 150, font2, 4)
drawfilloval (500,70,20,30,4)
[/code]
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Thu Jun 03, 2004 11:08 am   Post subject: (No subject)

1) Learn how to use [ code] tags properly.
2) You may want to invest in a dictionary...but then again, typsos are so common that you shouldn't owrry too much.
3) Use if's...As described here.
Cervantes




PostPosted: Thu Jun 03, 2004 2:38 pm   Post subject: (No subject)

more basic then ifs, you need to learn to use get.
here's a quick tutorial.

code:

var name : string
get name


get will pause the program and wait for the user to input something. the program will resume when enter is pressed. Whatever the user types in becomes the new value of the variable just after "get". in this case, if the user types in "Steve" and presses enter, the variable "name" is now equal to "Steve".
aside




PostPosted: Thu Jun 03, 2004 2:41 pm   Post subject: (No subject)

use mousewhere then check with whatdotcolour.
Cervantes




PostPosted: Thu Jun 03, 2004 2:58 pm   Post subject: (No subject)

aside wrote:
use mousewhere then check with whatdotcolour.


We're going for a simple solution here. Also, the program says "Press B" or "Press R", not click. Confused
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  [ 5 Posts ]
Jump to:   


Style:  
Search: