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

Username:   Password: 
 RegisterRegister   
 Simple Ideas
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
fear_ninja




PostPosted: Mon Jan 05, 2004 1:51 pm   Post subject: Simple Ideas

I need some ideas for my class project...I'm retarded with turing(dont even know how to use arrays and shit) It's only introduction to turing class but i need help thinin of a program to make. Just post ur little simple ideas that u have, thnx Laughing
Sponsor
Sponsor
Sponsor
sponsor
Boarder16




PostPosted: Mon Jan 05, 2004 4:09 pm   Post subject: (No subject)

make a saml lsimplified versio nof a game u like....cause u said ur not so...talented...make a board game ont eh computer...make some really nice graphics..lieka card game.. or snakes and ladders that woudl be sweet..... do taht...
Tony




PostPosted: Mon Jan 05, 2004 6:48 pm   Post subject: (No subject)

hah, snakes and ladders was one of the questions on last year's CCC Laughing So that should be easy enough to make Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
shorthair




PostPosted: Tue Jan 06, 2004 5:45 pm   Post subject: (No subject)

The easiest game you could probably make is a little box racing game , where you have to dodge object ( oval , box, arc) you know hte usual turing objects
fear_ninja




PostPosted: Fri Jan 09, 2004 1:17 pm   Post subject: (No subject)

shorthair wrote:
The easiest game you could probably make is a little box racing game , where you have to dodge object ( oval , box, arc) you know hte usual turing objects


thnx thats a good idea...ive done some work on it...can some1 help me out on how to make a little box move by pressing right and left

here it is drawfillbox (200, 10, 240, 45, 10)

i try to ues Input.KeyDown but i dunno wat im doin wrong..can any1 just help me out by tellin me a way to make that box move right or left by pressing the keyboard keys Embarassed
DanShadow




PostPosted: Fri Jan 09, 2004 2:56 pm   Post subject: (No subject)

Here is exactly what you'll need for that.
code:

var x, y : int := 180
var key : string (1) := ""


loop
    setscreen ("offscreenonly")
    View.Update
    Draw.FillBox (0, 0, maxx, maxy, 2)
    Draw.FillBox (100, 0, 350, 400, 255)
    for i : 0 .. 20
        Draw.FillBox (220, 0 + i * 30, 230, 20 + i * 30, 14)
    end for
    Draw.FillBox (x - 30, y - 50, x + 30, y + 50, 1)
    if hasch then
        getch (key)
    end if
    if key = (KEY_RIGHT_ARROW) then
        if x + 30 < 350 then
            x := x + 5
        end if
    elsif key = (KEY_LEFT_ARROW) then
        if x - 30 > 100 then
            x := x - 5
        end if
    elsif key = (KEY_DOWN_ARROW) then
        if y - 50 > 0 then
            y := y - 7
        end if
    elsif key = (KEY_UP_ARROW) then
        if y + 50 < 400 then
            y := y + 3
        end if
    end if
end loop

Use it wisely.
(Oh, and I added that its easier to go back, but harder to accelerate, and in between those two to move side to side.)
fear_ninja




PostPosted: Fri Jan 09, 2004 4:37 pm   Post subject: (No subject)

i tryed working it out in my program but i coudnt get it to work.
the underlined part is where im trying to make it move

setscreen ("graphics:450;350")
randomize
var chars : array char of boolean
var car, font : int
var y, y2, counter, counter2 : int := 0
drawfillbox (85, 203, 365, 170, 14)
font := Font.New ("sherif:25")
Font.Draw ("Press enter to start", 90, 175, font, red)
loop
Input.KeyDown (chars)
if chars (KEY_ENTER) then
cls
exit
end if
drawfillbox (200, 10, 240, 45, 10)
end loop
y := 300
loop
delay (1500)
drawfillbox (200, 10, 240, 45, 10)
exit
end loop
DanShadow




PostPosted: Fri Jan 09, 2004 5:30 pm   Post subject: (No subject)

right...so try adding what I have in my loop, to yours.
Sponsor
Sponsor
Sponsor
sponsor
fear_ninja




PostPosted: Fri Jan 09, 2004 5:56 pm   Post subject: (No subject)

i tried that but it just completly changes my program for that box i told u i want to move its just that i just wanted to know if u could give me the code to make it move either right or left Embarassed
DanShadow




PostPosted: Fri Jan 09, 2004 7:00 pm   Post subject: (No subject)

Fine....here ya go: The updated stuff is in bold...i think i got it all

%--------------------THE CODE---------------------------
setscreen ("graphics:450;350")
randomize
var chars : array char of boolean
var car, font : int
var y, y2, x, x2, counter, counter2 : int := 0
drawfillbox (85, 203, 365, 170, 14)
font := Font.New ("sherif:25")
Font.Draw ("Press enter to start", 90, 175, font, red)
loop
Input.KeyDown (chars)
if chars (KEY_ENTER) then
cls
exit
end if
drawfillbox (200, 10, 240, 45, 10)
end loop

x := 200
y := 10
x2 := 240
y2 := 45

loop

setscreen ("offscreenonly")
View.Update
Draw.FillBox (0, 0, maxx, maxy, 0)
drawfillbox (x, y, x2, y2, 10)
Input.KeyDown (chars)
if chars (KEY_RIGHT_ARROW) then
x := x + 2
x2 := x2 + 2
elsif chars (KEY_LEFT_ARROW) then
x := x - 2
x2 := x2 - 2
end if

end loop
%--------------------CODE ENDS---------------------------

This should help your direct question, heh.
fear_ninja




PostPosted: Fri Jan 09, 2004 7:14 pm   Post subject: (No subject)

thnx a lot man, im really new to turing dont really know much about it
DanShadow




PostPosted: Fri Jan 09, 2004 7:18 pm   Post subject: (No subject)

Your welcome. And if you want to learn more about Turing, check out the Source Code Forum....find out wh at code does what...or just think of a complex game...and look in the Help Menu (in Turing) to figure how certain things will make things in that game possible. Lol, I learned just as much from that and CompSci, than I did from my teacher...who has been teaching turing for years. Very Happy I really wish they would fund more money towards getting teachers more educated in the ways of Computer Science...its really annoying when people like us, who want to learn, can't because of our stupid schools.
McKenzie




PostPosted: Fri Jan 09, 2004 7:47 pm   Post subject: (No subject)

Dan, you miss the source of the problem, and I think once you see the truth that you won't see it as a problem. It is a simple matter of economics. When you have a degree in Computer Science you can make some real money in the field. Only a fool would go into teaching. Wheras some other degrees ... well you get the idea. So what ends up happening is the take whichever teacher has a clue about programming (usually the Math teachers, they tend to love learning for its own sake)

The reason this is good news for you. As a student of computer science (in the true sense, not just in a school sense) you should be happy to know that the world will one day appreciate your skills (in a very tangible way)
DanShadow




PostPosted: Fri Jan 09, 2004 7:57 pm   Post subject: (No subject)

Riiiight.......well that makes sense I guess.
And coincidentally, my Computer Science teacher is also my Math teacher, lol. But you make a lot of sense....stupid world, heh Razz
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  [ 14 Posts ]
Jump to:   


Style:  
Search: