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

Username:   Password: 
 RegisterRegister   
 Find the Hurkle Help PLZ! :)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Gadd




PostPosted: Fri Mar 30, 2012 6:40 pm   Post subject: Find the Hurkle Help PLZ! :)

hey guys :3 Hoping you could help me with a problem I'm having here. Basically I have a game and you need to find guess the x and y values.. so far I am making a nice grid for the user and I have the x numbers being 1 to 10 and the y values being 1 to 10 just the y values aren't aligned the way I want them to be ( left to right ) heres my code and it's commented I was wondering if you could help

Turing:

setscreen ("screen:45;55")%Set screen on inches.


procedure Left_to_Right
    %These are all the lines going left to the right
    Draw.Line (350, 700, 50, 700, black)%This is the line farthest to the left
    Draw.Line (350, 670, 50, 670, black)
    Draw.Line (350, 640, 50, 640, black)
    Draw.Line (350, 610, 50, 610, black)
    Draw.Line (350, 580, 50, 580, black)
    Draw.Line (350, 550, 50, 550, black)
    Draw.Line (350, 520, 50, 520, black)
    Draw.Line (350, 490, 50, 490, black)
    Draw.Line (350, 460, 50, 460, black)
    Draw.Line (350, 430, 50, 430, black)
    Draw.Line (350, 400, 50, 400, black)%This is the line farthest to the right
end Left_to_Right

procedure Up_to_Down
    %these are all the lines going from up to down
    Draw.Line (50, 700, 50, 400, black)%This is the line farthest left
    Draw.Line (80, 700, 80, 400, black)
    Draw.Line (110, 700, 110, 400, black)
    Draw.Line (140, 700, 140, 400, black)
    Draw.Line (170, 700, 170, 400, black)
    Draw.Line (200, 700, 200, 400, black)
    Draw.Line (230, 700, 230, 400, black)
    Draw.Line (260, 700, 260, 400, black)
    Draw.Line (290, 700, 290, 400, black)
    Draw.Line (320, 700, 320, 400, black)
    Draw.Line (350, 700, 350, 400, black)%This is the line farthest to the right
end Up_to_Down

procedure MAIN
  %Here is the 1 .. 10 for the y coord of the grid
  for decreasing y: 10 .. 1
    put ""
    put "":3, y
  end for
  %This is the for I'm hoping to make go left to right under the grid!! :3
  for x: 1 .. 10
    put ""
    put "":5, x %I wanna get this in a straight line some how.
  end for
end MAIN

MAIN%These are the procedures
Left_to_Right
Up_to_Down


I wanna make it look :


10
9
8
7
6
5
4
3
2
1
1 2 3 4 5 6 7 8 9 10 <-- this is what I cannot figure out how to do without doing:

put "":value, "1":values. "2" ... and so on @_@

THANKS IN ADVANCE!!!
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Fri Mar 30, 2012 6:54 pm   Post subject: Re: Find the Hurkle Help PLZ! :)

To have the following output continue where the last one ended, you use '..' (two periods)

Ex:
Turing:
% A simple multiplication grid
for i:1..10
  for j:1..10
    put i*j:4..
  end for
  put ""
end for
Gadd




PostPosted: Fri Mar 30, 2012 7:00 pm   Post subject: RE:Find the Hurkle Help PLZ! :)

I don't really understand what's going on in that, But you gave me a good idea about putting both for loops together like that, once I figure out how, I will play around thanks Smile
Raknarg




PostPosted: Sat Mar 31, 2012 3:58 pm   Post subject: RE:Find the Hurkle Help PLZ! :)

You dont understand cause you havent looked at it closely enough, Im sure you can figure it out.
Dreadnought




PostPosted: Sat Mar 31, 2012 4:07 pm   Post subject: Re: Find the Hurkle Help PLZ! :)

If you want a better idea of what's going on, you can try adding a delay (maybe like 100 ms) after the 'put i*j:4..' statement.

If the nested for loop is complicating things for you, you can remove the outer loop and just give 'i' a value.

Hope this helps.
Zren




PostPosted: Sat Mar 31, 2012 4:42 pm   Post subject: Re: Find the Hurkle Help PLZ! :)

Documentation: put

Quote:
put [ : fileNumber , ] putItem { , putItem } [ .. ]

The put statement outputs each of the putItems. Usually, a new line is started in the output after the final putItem. If the optional dot-dot (..) is present, though, subsequent output will be continued on the current output line. With character graphics, the omission of dot-dot causes the remainder of the output line to be cleared to blanks.
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  [ 6 Posts ]
Jump to:   


Style:  
Search: