search


Smile
Wed Apr 04 00:00:00 UTC 2018
Draw a happy face

Today in class we will focus on drawing a happy face. Here are questions you need to answer to draw a happy face

  • How do I draw a circle?
  • How do I move the turtle without drawing?
    • use (penup) to stop drawing. when pen is lifted, calling forward will move the turtle but not draw
    • use (pendown) to start drawing again.
  • How do I draw a semi-circle for the smiling mouth?
    • This is a hard one but look at the circle function. try to understand it. if you don't understand it, use the scientific method and experiment with it in the power turtle REPL

I expect you to struggle through this. This is normal. I remember my first experience programming. I was about your age. I found stack of computer magazine in someone's trash that had source code for games written in BASIC . I had no idea what the code is doing but I painstakingly spent hours typing in the code. What was the result after spending hours typing gibberish I didn't understand? Complete and utter frustration because it did not work due to some typing errors. But I was motivated to play the game so I took a break and tried again later. I finally got it to work after a couple of days fixing typos. I had no idea how the code works, but my interest in playing video games motivated me to learn what the cryptic BASIC code did. Art also motivated me to learn programming. I was facinated with fractals and was interested in learning how to draw fractals. This lead me to learning mathematics even though I hated math.

Drawing a happy face might not inspire you to learn programming but its a simple exercise to demonstrate programming ideas. Find something that motivates you, a problem you want to solve or something you find fun. When you find that right project, you will spend countless hours learning Clojure just so that you can build your project. We don't have enough time together in class for you to gain proficiency in Clojure. You need to motivate yourself and spend time outside of class working on projects that you are passionate about. I can give you guidance but I cannot give you motivation or passion. Seek it yourself and become a creator!

Here's an interview of Kai-Fu Lee , a well known researcher in Artificial Intelligence. He talks about the purpose of human beings if machines can replace routine tasks that people do now. The future is grim for people who are not creators. Be a creator and not a just simple consumer. Start experimenting with many things to find what interests you, then create. If you can't figure it out pick something at random and create something be it in art, music, or computer science or combine multiple disciplines. Passion is discovered when doing hard things and over coming challenges. Who wants to do something easy? There is no fun in that. If you ever find yourself in a stupor dull-drum as a teenager or an adult, just remember back to your childhood when the simpliest of things was a curiosity and facinating. Start from there to find your way again. Some of you have expressed interest in music. We can use Clojure to program music. Perhaps in the next few classes, I can show you how to program music with Clojure. Here is a preview