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

Username:   Password: 
 RegisterRegister   
 Help! i can't figure out how to use loop!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bvbjules13




PostPosted: Thu Oct 11, 2012 4:12 pm   Post subject: Help! i can't figure out how to use loop!

What is it you are trying to achieve?
Im trying to move my box across the screen using loop


What is the problem you are having?
I've looked at many examples and i don't seem to be able to grasp how to get my box to move across the screen (just the box, not one gigantic line, i need to get my box to move from one end to the other using loop)



Please specify what version of Turing you are using
4.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Oct 11, 2012 4:13 pm   Post subject: RE:Help! i can\'t figure out how to use loop!

The Turing Walkthrough
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
bvbjules13




PostPosted: Thu Oct 11, 2012 4:41 pm   Post subject: Re: RE:Help! i can\'t figure out how to use loop!

Tony @ Thu Oct 11, 2012 4:13 pm wrote:


already tried, cant seem to figure it out
Clayton




PostPosted: Thu Oct 11, 2012 4:47 pm   Post subject: RE:Help! i can\'t figure out how to use loop!

Turing:
var x, y : int := 0
loop
    x += 1
    y += 1
    put "x: ", x, " y: ", y
    Time.Delay (500)
end loop


Run it. What's it doing? How does it apply to your problem?
QuantumPhysics




PostPosted: Fri Oct 19, 2012 12:19 am   Post subject: RE:Help! i can\'t figure out how to use loop!

As clayton said to add in you just insert a View.update to fix the buffer every time the hWND proc changes and draw a shape and insert the x += 1 and loop it causing the x position of the box to change every time
Insectoid




PostPosted: Fri Oct 19, 2012 9:20 am   Post subject: RE:Help! i can\'t figure out how to use loop!

Clayton didn't say that, and View.Update() isn't necessary for this problem. It will just confuse OP more.

And what the heck is a hWND proc?
QuantumPhysics




PostPosted: Sat Oct 20, 2012 2:06 am   Post subject: RE:Help! i can\'t figure out how to use loop!

hWND proc is the run-time window as referenced in win32 API. Turing was not written in the C~ family?

Like C Dialog based API:

cplusplus:

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
        WNDCLASS wnd;
        MSG msg;
        HWND hwndScreen;
        HWND hwndValue;

        hInstance = hInst;
}


It's the define for the main window. All arguments reference back to it.


OP - DONT mind this post.
bvbjules13




PostPosted: Wed Oct 31, 2012 9:35 pm   Post subject: Re: Help! i can't figure out how to use loop!

Yea i understand it now thanks Smile
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: