Code is Poetry - Week 3 Learning Log

Begin logging your procedure by restating what topics you covered
This week I worked with the tutorials on if/then statements, booleans, and creating functions.

https://happycoding.io/tutorials/processing/if-statements
Then add what you tried in Processing,offering some details about what’s going through your mind as you learn.
At first, I’m thinking that this should be easy - I know what functions are and have called functions in other programs. I know about boolean logic and am just enough of a nerd to truly enjoy logic puzzles that require a lot of boolean logic. I work through the tutorials, and at the end of the tutorial is the suggested homework. I really enjoy the homework because it is differentiated, and offers the learner the ability to choose what they think their ability level is. In my short sighted thinking, I chose to create the program that depends upon the values of the mouse location on the sketch to draw different rectangles. This should be easy! How wrong I was! It has taken me 8 days to figure out the program (not that I was working on it each day, but I was reflecting on the process and procedures each day) and I finally figured it out today! I am very proud of myself!
Copy the error or “Traceback” message
I received the usual error messages of missing curly brackets, missing syntax. The biggest message was “boolean not called” which is Processing speak for “you created a useless boolean and the computer will not like wasting time processing it.” My errors mostly fell in the range of no output at all from the program or unexpected output.
Describe what you think the problem is
The problem lies in the programmer, as usual. I was typing too quickly, hence the missing curly brackets and semicolons. The other error was my overconfidence.
When you debug the error, describe the lesson you learn about Processing

Reflection | Think about everything you know about how human languages and communication work. What are important differences and similarities between computational and human languages?

This was a great week in terms of my final success, but it was humbling to learn how little I know despite my many years of work with computers. I found that I need to use a notebook and pencil to map out what it is I want the program to do, so that I can use my mental processing to focus on the creation of the program, rather than trying to figure out how to write the program while also figuring out what I want the program to do. Once I created a map of the quarters program (as I started to call it) I was able to then determine I needed one function for each square I wanted to draw. Then, the if statements would call those functions once their situation was satisfied. For example, I wanted four rectangles, so I created four functions that differed in the color of the rectangle and the location on the sketch. Then, I created the if statements to call on the required program when the mouse location was satisfied. Working through the program this way led to success, and I am sorry I did not try the mind mapping earlier in the week.
In terms of language learning in humans, this is what our ENL students deal with every single day, in every single class. They must first determine what they want to say in their native language, then they must begin to translate it, after first locating the proper vocabulary and hoping they have the syntax correct. Then they have to say the words as best they can, and then...they have to process a response - which then must be processed in reverse. For computers - this process is lightning fast, but for humans it can be painstakingly slow. This just reinforces my practice in the classroom of being patient and allowing students to finish processing before speaking, or finish processing before I add more responses. When you have students in your class that are working from a different language, it is important to give them the time and space to be able to work through the vocabulary and the syntax without fear of being rushed, being ridiculed, or making them feel as if they are holding the class up. It can help if there is a cheat sheet for them of vocabulary, because similar to the mindmap I made on paper, that can help with some of the processing steps that slowed me down this week.
Here’s my mind map and the code I wrote:

//create function for each rectangle

void drawRed(){

fill(255,0,0);

rect(0, 0, 100, 100);

}

void drawBlue(){

fill(0, 0, 255);

rect(100, 0, 100, 100);

}

void drawGreen(){

fill(0, 255, 0);

rect(100, 100, 100, 100);

}

void drawPurple(){

fill(255, 0, 255);

rect(0, 100, 100, 100);

}


 

//create active code

void setup(){

size(200, 200);

}

void draw(){

background(255);

if(mouseX<100 && mouseY<100){

drawRed();

}

else if(mouseX<100 && mouseY>100){

drawPurple();

}

else if(mouseX>100 && mouseY>100){

drawGreen();

}

else if(mouseX>100 && mouseY<100){

drawBlue();

} }



 

Square A:

fill(255,0,0) (red)

rect(0, 0, 100, 100)

mouseX<100

mouseY<100

Square B:

fill(0, 255 ,0)

rect(100, 100, 100, 100)

mouseX>100

mouseY<100

Square B:

fill(255, 0 ,255)

rect(0, 100, 100, 100)

mouseX<100

mouseY<100

Square C:

fill(255, 0 ,255)

rect(100, 0, 100, 100)

mouseX>100

mouseY>100

    • Gerald Ardito
      Gerald Ardito

      Suzie,

      I loved your code and your cheat sheet.

      I also appreciated your reflection and connections to many other things being languages.

    Computer Science for Teachers Spring 2019

    Computer Science for Teachers Spring 2019

    Here is the online home for CS for Teachers at Pace University for Spring 2019.

    Latest comments