knowyourknot
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
class Calendar < Shoes
url '/', :cal
url '/about', :about
def cal
stack do
## The line drawing below worked until I tried to make
## it part of the "cal" page...
## Substituting this line drawing for the para "------"
## lines in Cyber's original program is the reason I started
## modifying it in the first place.
cap(:curve)
stroke black
strokewidth 4
line(left+10,self.height-80,self.width-10,self.height-80)
line(left+10,self.height-270,self.width-10,self.height-270)
## end line drawing.
para "A Basic calendar that displays the Time and Date", :left => 10
@title = title Time.now.strftime("%A the %dth of %b, %Y"), :left=>10
end
stack do
@p = tagline "", :left=>10
every 0 do
@p.replace(Time.now.strftime("%I:%M:%S%p"))
end
end
stack do
flow do
button "I'm Done", :left=>10 do close() end
para link("about", :click => '/about')
end
end
every 2 do
@title.replace(Time.now.strftime("%A the %dth of %b, %Y"))
end
every 0 do
@p.replace(Time.now.strftime("%I:%M:%S%p"))
end
end
def about
stack do
flow do
para "Original program = ",
link("calendar_basic",
:click => 'http://hackety-hack.com/programs/cyber/calender_basic'),
" by ",
link("cyber.",
:click => 'http://hackety-hack.com/hackers/cyber')
end
flow do
para "Modified for stroking and pagenation by ",
link("know your knot.",
:click => 'http://hackety-hack.com/hackers/knowyourknot')
end
flow do
para link("Go back to Calendar",
:click => '/')
end
end
end
end
Shoes.app :title => "Calendar Basic", :width =>575, :height =>300