mju and many others are using Hackety Hack to learn how to code.

Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.

Sign up Learn More

shapedraw by mju

Turtle.draw do
  background lightslategray
  pencolor honeydew 
  num = ask "How many sides would you like the shape to have?"
  number= num.to_i
  if number%4==0
    number.times do
    forward 50
    turnright (180-((180*(number-2))/number))
      end
  else
    turnleft  (((180*(number-2))/number)-90)
    number.times do
    forward 50
    turnright (180-((180*(number-2))/number))
      end
   end 
 end