The other day I helped try to get some kids into computer programming at a local Secondary school. I gave them all a printed copy of a new Gideros guide I wrote (it's available from here:
https://www.facebook.com/sinistersoft?fref=ts ).
I hoped to encourage them to type in the listings, play them, modify them, etc...
It was a great success, the kids loved Gideros and there was some really good results.
The only real problem came from them typing in the listings, it was difficult for them to get everything correct - especially the upper and lowercase letters, etc.
I think that if the Gideros editor could have an optional 'checksum' column that could be enabled/disabled it would solve the problem. The children would realise that the checksum on the editor and the checksum in the listing did not match - so they could then recheck that line more carefully.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com
Comments
Not sure how that would be done with textual data/code.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
If I put the screen shot in a leaflet or book then the reader can check that they have each line typed in correctly as they go. This way they don't have loads of errors due to spelling mistakes or upper/lower case problems.
I don't propose the compiler checks the checksum - it's just an optional editor feature if they are typing in a listing that was screen grabbed (or printed from the editor?).
The magazine listings in the 80's had them printed and the editors were hacked to display the number on screen. The best way of getting kids to learn is by getting them to type things in rather than just load or download routines - it's also more fun.
The checksum could be a 16 bit number in hex.
https://deluxepixel.com
One possibility might be to encourage one of the other compatible IDEs like @paulclinger 's ZBS to add this as a feature.
best regards
Likes: SinisterSoft
ZBS also includes static analyzer that is supposed to catch most of these errors.
If you give me your checksum algorithm, I can probably take a stub at it today... you can then tweak it to your liking...
Likes: SinisterSoft
The kids like typing things in, so the listings would also have the checksum printed next to the line (either by screenshot or by a listing print from the editor?).
Having the checksum next to the line they are typing gives the an extra element of 'fun' when typing in listings.
A live checksum should be easy to code (you just recalc the checksum if the line changes).
I've not got a checksum algorith yet. lol. Currently it's just an idea. Whatever it is though it should skip leading and edge blanks/tabs, etc as that would just complicate things.
With the new push in the UK for computer programming in Primary/Secondary education Gideros could well be used in quite a lot of schools if they play their cards right.
In the UK the Government has announced that from September 2013 ICT is being changed to Computing for all four keystages (KS1 to KS4) with programming having a major role.
At the school I went to the kids seemed to prefer this to Scratch and Python - typing things in and the possibility of getting things displayed on their own phone or tablet is very exciting for them.
https://deluxepixel.com
for examle
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
local b=2
local c =3
These should me ok with the space missing shouldn't they? Before the checksum is created, strip all spaces/invisible characters. At least the checksum will show that the line is incorrect and they should check it (even with a checksum then line may be incorrect but the checksums match).
I'd say use the standard crc32 algorithm, but keep only the lower 16 bits - eg just show something like FEDC, don't even bother with the 0x or $.
https://deluxepixel.com
However, where to display it is slightly trickier. I don't think a comment is a good idea for two reasons. First is that this needs to be displayed as the user types. That would mean altering th source as you type, which would be messy. Also the comment would have to go at the end of each line, which would be visually unappealing. Although it may not be a five minute addition I think there should be an extra margin pane in the editor that displays the checksum as the line is being typed. This could be left or right justified.
@SinisterSoft, the reason I suggested ZBS for this is that I've had several conversations with @paulclinger in the past and know that he's interested in the educational potential of Lua. I'm also keen on this and, since I'm in the UK too, am very interested in your thoughts on getting stuff into UK schools.
Best regards
Likes: SinisterSoft
Best regards
https://deluxepixel.com
best regards
Likes: SinisterSoft
https://deluxepixel.com
Another reason for suggesting comments was that you not only need to type them, but you also (as a teacher) need to print them. It would be trivial to write a script that adds these comments before printing (but not so trivial if it's kept in a separate column in the editor).
I can propose an alternative that should work well with ZBS (and probably other IDEs). I can display this checksum in the status bar, which would allow you to see it for the line the cursor is on. It would be updated every time you change something in the editor (or when you move the cursor). Your users can still use it as a quick check mechanism, but it's not going to be in their ways.
> For each line use a regex to replace all whitespace characters by a single space then xor up all characters.
That's easy enough. I can probably take few minutes to try this...
Likes: SinisterSoft
(So you use Scintilla for your editor component? So do I in my reports program: http://reportcomplete.com/ Scintilla is great. )
https://deluxepixel.com