Blank-Canvas program which plots a set of random points on a graph. Two players are then each asked to write an inequality function so as to try and cover as many points on the graph as possible.
runghc point-plotter.hs
to run, and CTRL+C
to quit.
y <= [(2,3),(0.5,2)]
is like y <= 2x^3 + (0.5)x^2y >= [(-0.1,0)]
is like y >= (-0.1)
If you're using polynomials of degree > 1, make your coefficients small --- they are plotted on a 600x600 graph, so even x^2 goes off the charts fairly quickly.
tested on an Ubuntu 14.04 virtualbox under Vagrant.
- Haskell Platform
- Blank-Canvas:
cabal install blank-canvas
- Plot chart setup function
- Function to complete box after function to be filled in
- Generate random numbers within range
- Function to plot random points on graph
- Function to change color of dot if within plot
- Function to check status of MVar for user input
- Data types for simple-parse polynomial expressions
- Function to prompt for user equation
- Display values of lines on plot
- Break into server/client threads
- Data type and parser for better representation of polynomials
- ~~ Applicative/Monadic point, as in class example~~