Posts

Showing posts from November, 2017

Debugging programs for students by students

Image
When creating projects using pencilcode.net one of my classes had some problems when the program would stop and get an error.  So they created a list of rules to help find the errors. We called it "debugging their program".  Things to look for with errors Highlighted row (2) Message on the right side in a grey box. Red writing in the bottom right with a description of the error. To create the rules students got into small groups (2-3 people) and opened a program that worked. Then they changed things in the program to see what would happen.  Please comment if you have some more rules that could be added. Rules for Pencilcode.net These rules are specific to pencilcode.net but they could be used as a guide for other programs. Check your spelling. Check your indenting & spacing. Use spaces between your words. Check punctuation eg: “ ”, (), [ ], { }, @, >, < Check the size of your jumps. Check the things you type. Check that you don’t put a

Music in Pencilcode.net

Image
Pencilcode.net has some very neat tricks. Did you know it can play music. This was information was originally sent to me as an example by David Bau the pencilcode creator.  https://twitter.com/pencilcoder Using the play command you can make music.  http://imerinet.pencilcode.net/edit/FirstPlay A quaver (or half note) is play "c/2' A crotchet (1 beat) is play "c" A minum (2 beat) is play "c2" A semibreve (4 beats) is play "c4" A dotted crotchet (1 1/2 beats) is play "c11/2" A rest is z Use ^ (for sharp) for c# use play "^c" Use _ (for flat) for Bb use play "_b" Use ' for an octave higher play "c'c" Use , for an octave lower play "c,c" You can do chords by surrounding more than one note in [brackets] play "[G^DG,]" Type this into a new file in Pencilcode.net: play “  F ^G c f  [gE] c ^G  g [^g^D] c  ^G ^g [dD]  ^A F d  [^