Post Reply 
Teaching kids real math with computers/calculators
08-26-2018, 09:42 PM
Post: #17
RE: Teaching kids real math with computers/calculators
(08-26-2018 04:22 PM)Csaba Tizedes Wrote:  The real question is that, what is a good programming language for kids?

The question is not only which language but what they want to achieve with their programs. Maybe you ask them.


Clojure

Maria is a coding environment for beginners.
Creating graphics gives them immediate feedback and a feeling of achievement.

JavaScript

Another possibility is using JavaScript with Canvas in Chrome (or Firefox):
  • To start the developer tools use key F12 and switch to the tab Sources → Filesystem.
  • Create a folder on your desktop and add it to the workspace by dragging and dropping it.
  • You have to give Chrome access to do so.
  • Now you can create new files from within Chrome.
  • Make sure to use only the good parts of JavaScript.

The HTML file graphic.html must be loaded from the browser and just contains these lines:
PHP Code:
<!DOCTYPE html>
<
html>
  <
head>
    <
meta charset="UTF-8">
  </
head>
<
body>
 
<
canvas id="white-board" width="800" height="500" style="border:1px solid #000000;">
</
canvas>
 
<
script src="graphic.js"></script>
</body>
</html> 

Note:
You can set width and height differently.

The JavaScript file graphic.js contains the code. The function clean clears the canvas and moves the context ctx to the center of the canvas:
Code:
const canvas = document.getElementById("white-board");
const ctx = canvas.getContext("2d");
const W = canvas.width;
const H = canvas.height;
 
function clean() {
    // clear canvas
    ctx.setTransform(1, 0, 0, 1, 0, 0);
    ctx.clearRect(0, 0, W, H);
    // move to center
    ctx.translate(W/2, H/2);
}
 
clean();

Now you can use the Console and make experiments by writing code snippets.
Once you have something meaningful extract it into a new function in the JavaScript file.
Documentation: HTML Canvas Reference

You have a debugger which allows to set breakpoints and step through the code.

Raspberry Pi

Personally I would advise against using calculators to start learning programming.

Kind regards
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calculators for kids - Csaba Tizedes - 08-26-2018, 09:07 AM
RE: Teaching kids real math with computers/calculators - Thomas Klemm - 08-26-2018 09:42 PM



User(s) browsing this thread: 1 Guest(s)