Bug in Calculator program in p5.js

My son Simon, a 7 year old programmer, has attempted to write a code for a calculator in the p5 web editor. He managed to create the design looking exactly like his favourite Solve calculator app (on the iPad) and the buttons seemed clickable, but there must be some kind of bug in his code as nothing appears in the input. The link to entire code is below — should anyone know what the problem is, please let us know! (You'll see that the mouse interaction is in a loop in Line 52: .mousePressed(add); but he also tried it as an anonymous function and it didn’t work either).

Code:https://alpha.editor.p5js.org/simontiger/sketches/SJOev0Pnx

Blog entry with video about the project: https://antwerpenhomeschooling.wordpress.com/2017/03/29/simons-next-own-code-calculator/

Sign In or Register to comment.