skip to content

JavaScript: Graphing Game

This is a pure JavaScript recreation of an old Apple II game from the 1980's used to teach cartesian equations. Each equation you enter plots a line on the grid and you have five tries to hit all five targets in order to win.

In the original you could also draw circles, but we're not that sophisticated. In this version bonus points are awarded for hitting multiple targets with a single line.

Let's Play

The game generates sound effects in browsers with AudioContext support, which includes most modern browsers. You can learn about AudioContext interface in our article Creating Sounds with AudioContext.

Example Equations

In case your math is a bit rusty, here are some example to help you get started. Equations can be a function either of y or of x:

  • y = 2
  • y = x
  • x = -3y + 3
  • y = x(x+3)(x+1) + 1
  • y = 2x2 - 2x/3 + 4

Screenshots

Have fun, and if you make some cool lines, send us a screenshot.

References

< JavaScript

User Comments

Post your comment or question

9 February, 2024

We solved the problem of five points with an algebraic eqauation of fourth degree. It worked only with fraction input, not decimals (they missed the points), and it was a little bit hard to find the right syntax.
Cheers Klaus and Keziah (and solving computer)

top