Documents

yo.pdf

Description
Task Sheet 1: First Steps Please note: The following tasks will require Processing installed on your computer. Please do that prior to working on the tasks. Don’t worry if you don’t understand the programs on this sheet. It isn’t required. Task 1: Processing Examples Open and run at least ! Processing examples from the “Basics” folder. Look at the code of each of them. Don’t worry if you don’t understand it, just go through it with an open mind. Write down which similarities y
Categories
Published
of 2
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
    Task Sheet 1 : First Steps   Please note:  The following tasks will require Processing installed on your computer. Please do that prior to working on the tasks. Don’t worry if you don’t understand the programs on this sheet. It isn’t required. Task 1: Processing Examples Open and run at least !  Processing examples from the “Basics” folder. Look at the code of each of them. Don’t worry if you don’t understand it, just go through it with an open mind.  Write down which similarities you can detect in the code structure of the examples you’ve opened. Any conclusions you can draw from your observations? Task 2: Counting with Fingers How far can you count with the five fingers of one of your hands if ã    you have  fingers ã   each number is represented by a unique finger combination ã    you start counting at zero ã   in each step you increment your count by #  Hint: think of your finger configurations as states representing numbers. Justify your answer.  Task 3: Numbers Create a new Processing Script (File->New) and write down the following code: println(1); println(2);  Try the following: a)   Run the program and see what happens b)   Now extend the program to print the numbers # - #$  c)   Can you do the same for # - #$$  or even # - #$$$ ? Game Development I    d)   To print only the odd numbers in the range # - #$$ , how would you approach that? (You don’t have to program it) e)   How would you approach the problem, if the requirement is to only print prime numbers between # - #$$ ? (You don’t have to program it) Task 4: Shapes Create a new Processing Script and write the following lines: size(200,200); ellipse(56, 46, 55, 55); a)   Run the script and see what happens. b)   Can you find out what the numbers in brackets mean? Experiment and describe  your findings. c)   Use the Processing help page (Help->Reference) to look it up. Was your finding correct? d)   Now extend the program to draw an additional square, right next to the circle. Use the help page again. (Hint: a square is a rectangle with equal sides). e)    When changing the numbers in brackets playing around with the shape sizes and positions it is quite cumbersome to type in values, start the sketch, stop the sketch, and then again change the values. Can you think of a way to simplify this process by changing all the parameters in one area of the code? Provide an example code. f)    Assume you want the circle and square to always have a fixed size (no changes) and be at the same position relative to each other  . Only the absolute position of the circle shall be changeable. How could you make it more comfortable for yourself to run tests with different positions of the shapes? Provide an example program. Task 5: Shape-o-mania Create a new Processing Script and use the shape commands from the former task to draw a rectangle of a fixed size on a window with width %$$  and height %$$ . a)   Now use the help page to draw the same rectangle with different border and fill colors. b)    Assume you want to re-use the code for drawing the colored rectangle with any color combination for border and fill color. Are there any mechanisms to make the shape drawing code general for arbitrary colors and re-usable at any place in your code? Provide an example code. c)    Also make the position of your rectangle redefinable, but not its size. d)    With you new superpowers to draw arbitrary colored rectangles at any given position, draw a x  !  matrix of these rectangles with a fixed spacing between rows and columns. e)   Extend the code to draw an arbitrary NxM matrix of these rectangles, with N and M being integer numbers. Can you again make the code generic and re-usable for any  values N and M? Provide an example code.
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks