I found this code on open processing and it uses if statements quite heavily throughout the code in fact it is most of the code. The code is for an abstract clock . The code says that lines are related to seconds and so the code uses if statement to say if say one second passes a line will show at a certain point on the page, every second another line is formed and this creates a zig zag pattern right around the page. the code also uses if statements for minutes using the same as the second but dots per minute in twine the zig zagged pattern. Each time the second reaches a minute the zig zag pattern resets, each time the minute dots reach an hour they also reset. This code does not rely on mouse or key interaction and simply on minutes and seconds. It doesn't have else statements as well because each if statement is like a separate occasion not relying on there parts of the code as they a separate layers............... so to speak...
No comments:
Post a Comment