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

Username:   Password: 
 RegisterRegister   
 Help on my project due in two days
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
firex2249




PostPosted: Wed Jan 16, 2008 5:25 pm   Post subject: Help on my project due in two days

I have a project and the main problem I am facing is dragging words and almost everything else. So can some explain to what i can do to finish this project, plz. It wil be so happy. The instructions for my project are:

You have been hired by the grade 5 English teacher to test a student's ability to put 5 words in alphabetical order. Five randoms words are displayed vertically on the left side of the screen with 5 empty vertical spaces on the right. The students selects each word and moves it to right side of the screen placing it correctly in order. If the words are in correct alphabetical order, a green LED flashes on a corresponding peripheral to indicate the entry is correct. If not, a red LED flashes.

THANKS AGAIN IF YOU HELP ME
Sponsor
Sponsor
Sponsor
sponsor
Gooie




PostPosted: Wed Jan 16, 2008 7:10 pm   Post subject: Re: Help on my project due in two days

So what your saying is you want us to do the project for you?

*Pop Up*
You have performed an illegal operation.
firex2249




PostPosted: Wed Jan 16, 2008 7:16 pm   Post subject: Re: Help on my project due in two days

No i should have been clear, i meant help me drag words. Srry for the trouble.Here is what i got so far:


put " Alphabetical Order Game"
put "List of words:"..
put " Words in alphabetical order:"
put ""
put "Noob"
put ""
put "ball"
put ""
put "keyboard"
put ""
put "book"
put ""
put "ruler"



drawbox (50, 50, 125, 125, blue)
locatexy (75, 82)
put "EXIT" ..

var x, y, button : int

loop
mousewhere (x, y, button)
% If button the is clicked, exits the program.
exit when 50 <= x and x <= 125 and 50 <= y and y <= 125 and button = 1
Tony




PostPosted: Wed Jan 16, 2008 7:16 pm   Post subject: RE:Help on my project due in two days

If the use of a mouse to drag things confuses you, you could choose to settle for keyboard input to finish the project.

Otherwise use Mouse.Where() to figure out where the pointer is, and change a target word's location to the same set of co-ordinates.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
firex2249




PostPosted: Wed Jan 16, 2008 7:19 pm   Post subject: Re: RE:Help on my project due in two days

Tony @ Wed Jan 16, 2008 7:16 pm wrote:
If the use of a mouse to drag things confuses you, you could choose to settle for keyboard input to finish the project.

Otherwise use Mouse.Where() to figure out where the pointer is, and change a target word's location to the same set of co-ordinates.


So can you explain to me where to use it cause I am beginner
syntax_error




PostPosted: Wed Jan 16, 2008 8:33 pm   Post subject: Re: Help on my project due in two days

yes we can show you here find it on your own
magical
firex2249




PostPosted: Wed Jan 16, 2008 10:05 pm   Post subject: Re: Help on my project due in two days

Well i didnt use the mouse where but settled for keyboard, so thx:


put " Alphabetical Order Game"
put "*To exit the game type:stop*"

put "List of words:"

put "a.noob"

put "b.ball"

put "c.keyboard"

put "d.book"

put "e.ruler"
loop
var word : string

put ""
put "Please put the words in orders(ex. a,b,c,d,e)"
get word

if word = "b,d,c,a,b" then
put "WEll DONE"
parallelput (1)
else
put "Invalid choice"
parallelput (2)
exit when word = "stop"
end if
end loop
StealthArcher




PostPosted: Wed Jan 16, 2008 10:07 pm   Post subject: RE:Help on my project due in two days

Nice, now if you want, try to improve it to using the mouse, since you do have something to hand in, no stress.
Sponsor
Sponsor
Sponsor
sponsor
Zampano




PostPosted: Wed Jan 16, 2008 10:23 pm   Post subject: Re: Help on my project due in two days

That would be an excellent entry, except for the typo that makes it faulty.The correct last word is 'e'.
If you want to do it with the mouse, then you should hold variables which represent the x and y locations of each word. Then, compare the location of the mouse to the location of each word, thus determining if the mouse is over the word. If it is, check if the mousebutton is down. That given, adjust the word location so that the mouse is about in the middle of it (the mouse can only move a bit each moment, so the word will continue to follow the mouse as long as the button is down and the location is within the bounds of the x and y of the word being carried.
To improve the program, you can use a value to hold information on whether or not the cursor currently has a word attached to it, so that you can make it ignore other words if one is currently being carried.
firex2249




PostPosted: Thu Jan 17, 2008 5:44 pm   Post subject: Re: Help on my project due in two days

Zampano @ Wed Jan 16, 2008 10:23 pm wrote:
That would be an excellent entry, except for the typo that makes it faulty.The correct last word is 'e'.
If you want to do it with the mouse, then you should hold variables which represent the x and y locations of each word. Then, compare the location of the mouse to the location of each word, thus determining if the mouse is over the word. If it is, check if the mousebutton is down. That given, adjust the word location so that the mouse is about in the middle of it (the mouse can only move a bit each moment, so the word will continue to follow the mouse as long as the button is down and the location is within the bounds of the x and y of the word being carried.
To improve the program, you can use a value to hold information on whether or not the cursor currently has a word attached to it, so that you can make it ignore other words if one is currently being carried.


what do u mean by compare the location of the mouse to the location of each word?
is there code for that with mouse where and this what i did so far:

var x, y, button : int
loop
Mouse.Where (x, y, button)
locatexy (1, 300)
put "apple"
if button = 1 then
end if
end loop
Tony




PostPosted: Thu Jan 17, 2008 5:56 pm   Post subject: RE:Help on my project due in two days

no, it's more like
Turing:

var x, y, button : int
loop
   Mouse.Where (x, y, button)
   locatexy (x,y)
   put "apple"
   cls
end loop
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
firex2249




PostPosted: Thu Jan 17, 2008 5:56 pm   Post subject: Re: Help on my project due in two days

Using this i can see the same word twice but how can i make it let the second stay instead of disappering when i let the mouse button go, here it is:

var x, y, button : int
loop
Mouse.Where (x, y, button)
locatexy (1, 300)
put "apple"
if button = 1 then
locatexy (100,300)
put "apple"
end if
end loop
firex2249




PostPosted: Thu Jan 17, 2008 6:18 pm   Post subject: Re: RE:Help on my project due in two days

Tony @ Thu Jan 17, 2008 5:56 pm wrote:
no, it's more like
Turing:

var x, y, button : int
loop
   Mouse.Where (x, y, button)
   locatexy (x,y)
   put "apple"
   cls
end loop


So if that allows me to hold on to it how do I let the word go and stays at the postion untill selected again?(This stuff is hard>Sad)
Nick




PostPosted: Thu Jan 17, 2008 6:21 pm   Post subject: RE:Help on my project due in two days

try something like
Turing:
var mx,my,mb:int
var wordx,wordy:int
wordx:=1
wordy:=300
loop
    cls
    Mouse.Where (mx, my, mb)
    locatexy (wordx, wordy)
    put "apple"
    if button = 1 then
        wordx:=mx
        wordy:=my
    end if
end loop
firex2249




PostPosted: Thu Jan 17, 2008 6:26 pm   Post subject: Re: RE:Help on my project due in two days

momop @ Thu Jan 17, 2008 6:21 pm wrote:
try something like
Turing:
var mx,my,mb:int
var wordx,wordy:int
wordx:=1
wordy:=300
loop
    cls
    Mouse.Where (mx, my, mb)
    locatexy (wordx, wordy)
    put "apple"
    if button = 1 then
        wordx:=mx
        wordy:=my
    end if
end loop

I tried it didnt work, thanks anyways:(
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 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: