
-----------------------------------
firex2249
Wed Jan 16, 2008 5:25 pm

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

-----------------------------------
Gooie
Wed Jan 16, 2008 7:10 pm

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
Wed Jan 16, 2008 7:16 pm

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 :()

-----------------------------------
Nick
Thu Jan 17, 2008 6:21 pm

RE:Help on my project due in two days
-----------------------------------
try something like
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
Thu Jan 17, 2008 6:26 pm

Re: RE:Help on my project due in two days
-----------------------------------
try something like
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:(

-----------------------------------
Zampano
Thu Jan 17, 2008 7:05 pm

Re: Help on my project due in two days
-----------------------------------
It does, you just need to change his variable name from 'button' to 'mb' to eliminate the ensuing error.

-----------------------------------
firex2249
Thu Jan 17, 2008 7:19 pm

Re: Help on my project due in two days
-----------------------------------
I did what you asked know how do u do that with my 5 words at the same , i tried this but it didnt work, also i want to add an exit button at the same how can i do that together, like its going to be a game and stuff:


var mx1, my1, mb1 : int
var wordx1, wordy1 : int
wordx1 := 1
wordy1 := 300
loop
cls
    Mouse.Where (mx1, my1, mb1)
    locatexy (wordx1, wordy1)
    put "Noob"
    if mb1 = 1 then
        wordx1 := mx1
        wordy1 := my1
    end if
end loop

var mx2, my2, mb2 : int
var wordx2, wordy2 : int
wordx2 := 1
wordy2 := 300
loop
cls
    Mouse.Where (mx2, my2, mb2)
    locatexy (wordx2, wordy2)
    put "Ball"
    if mb2 = 1 then
        wordx2 := mx2
        wordy2 := my2
    end if
end loop
var mx3, my3, mb3 : int
var wordx3, wordy3 : int
wordx3 := 1
wordy3 := 300
loop
cls
    Mouse.Where (mx3, my3, mb3)
    locatexy (wordx3, wordy3)
    put "Keyboard"
    if mb3 = 1 then
        wordx3 := mx3
        wordy3 := my3
    end if
end loop
var mx4, my4, mb4 : int
var wordx4, wordy4 : int
wordx4 := 1
wordy4 := 300
loop
cls
    Mouse.Where (mx4, my4, mb4)
    locatexy (wordx4, wordy4)
    put "Book"
    if mb4 = 1 then
        wordx4 := mx4
        wordy4 := my4
    end if
end loop

var mx5, my5, mb5 : int
var wordx5, wordy5 : int
wordx5 := 1
wordy5 := 300
loop
cls
    Mouse.Where (mx5, my5, mb5)
    locatexy (wordx5, wordy5)
    put "Ruler"
    if mb5 = 1 then
        wordx5 := mx5
        wordy5 := my5
    end if
end loop

-----------------------------------
Yagami_Light
Thu Mar 20, 2008 8:18 pm

Re: Help on my project due in two days
-----------------------------------
I saw this post a couple of days ago and thought the program looked interesting so i decided to make it and I'm attaching it to this post.
To move the words you have to click on them and drag them to a different place without letting go the button and then let go when you placed them where you wanted. Don't move the mouse too fast or you will lose the word. You have to click on submit when you are done moving the words.I used Bubble sort to sort the words in alphabetical order and it works well because there aren't many things to sort. So tell me what you think =3

-----------------------------------
A.J
Fri Mar 21, 2008 7:47 am

Re: Help on my project due in two days
-----------------------------------
hey firex2249
welcome to compsci.ca!

try changing 'button' to 'mb' and it should work + add View.Update to make a flicker free animation:

View.Set ("offscreenonly")
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 mb = 1 then
        wordx := mx
        wordy := my
    end if
    View.Update
end loop

I suggest that you learn more about mouse/keyboard manipulation.

A.J
