From classroom experiments to computer code