Skip to content

Instantly share code, notes, and snippets.

@hugolu
Created June 26, 2016 16:23
Show Gist options
  • Save hugolu/79f9436066d9a8dce31807d869f32eb9 to your computer and use it in GitHub Desktop.
Save hugolu/79f9436066d9a8dce31807d869f32eb9 to your computer and use it in GitHub Desktop.
add_dict = { (0.0,0.0):0.0, (0.0,1.0):1.0, (0.0,2.0):2.0, (0.0,3.0):3.0, (0.0,4.0):4.0, (0.0,5.0):5.0, (0.0,6.0):6.0, (0.0,7.0):7.0, (0.0,8.0):8.0, (0.0,9.0):9.0, (1.0,0.0):1.0, (1.0,1.0):2.0, (1.0,2.0):3.0, (1.0,3.0):4.0, (1.0,4.0):5.0, (1.0,5.0):6.0, (1.0,6.0):7.0, (1.0,7.0):8.0, (1.0,8.0):9.0, (1.0,9.0):10.0, (2.0,0.0):2.0, (2.0,1.0):3.0, (2.0,2.0):4.0, (2.0,3.0):5.0, (2.0,4.0):6.0, (2.0,5.0):7.0, (2.0,6.0):8.0, (2.0,7.0):9.0, (2.0,8.0):10.0, (2.0,9.0):11.0, (3.0,0.0):3.0, (3.0,1.0):4.0, (3.0,2.0):5.0, (3.0,3.0):6.0, (3.0,4.0):7.0, (3.0,5.0):8.0, (3.0,6.0):9.0, (3.0,7.0):10.0, (3.0,8.0):11.0, (3.0,9.0):12.0, (4.0,0.0):4.0, (4.0,1.0):5.0, (4.0,2.0):6.0, (4.0,3.0):7.0, (4.0,4.0):8.0, (4.0,5.0):9.0, (4.0,6.0):10.0, (4.0,7.0):11.0, (4.0,8.0):12.0, (4.0,9.0):13.0, (5.0,0.0):5.0, (5.0,1.0):6.0, (5.0,2.0):7.0, (5.0,3.0):8.0, (5.0,4.0):9.0, (5.0,5.0):10.0, (5.0,6.0):11.0, (5.0,7.0):12.0, (5.0,8.0):13.0, (5.0,9.0):14.0, (6.0,0.0):6.0, (6.0,1.0):7.0, (6.0,2.0):8.0, (6.0,3.0):9.0, (6.0,4.0):10.0, (6.0,5.0):11.0, (6.0,6.0):12.0, (6.0,7.0):13.0, (6.0,8.0):14.0, (6.0,9.0):15.0, (7.0,0.0):7.0, (7.0,1.0):8.0, (7.0,2.0):9.0, (7.0,3.0):10.0, (7.0,4.0):11.0, (7.0,5.0):12.0, (7.0,6.0):13.0, (7.0,7.0):14.0, (7.0,8.0):15.0, (7.0,9.0):16.0, (8.0,0.0):8.0, (8.0,1.0):9.0, (8.0,2.0):10.0, (8.0,3.0):11.0, (8.0,4.0):12.0, (8.0,5.0):13.0, (8.0,6.0):14.0, (8.0,7.0):15.0, (8.0,8.0):16.0, (8.0,9.0):17.0, (9.0,0.0):9.0, (9.0,1.0):10.0, (9.0,2.0):11.0, (9.0,3.0):12.0, (9.0,4.0):13.0, (9.0,5.0):14.0, (9.0,6.0):15.0, (9.0,7.0):16.0, (9.0,8.0):17.0, (9.0,9.0):18.0, }
sub_dict = { (0.0,0.0):0.0, (0.0,1.0):-1.0, (0.0,2.0):-2.0, (0.0,3.0):-3.0, (0.0,4.0):-4.0, (0.0,5.0):-5.0, (0.0,6.0):-6.0, (0.0,7.0):-7.0, (0.0,8.0):-8.0, (0.0,9.0):-9.0, (1.0,0.0):1.0, (1.0,1.0):0.0, (1.0,2.0):-1.0, (1.0,3.0):-2.0, (1.0,4.0):-3.0, (1.0,5.0):-4.0, (1.0,6.0):-5.0, (1.0,7.0):-6.0, (1.0,8.0):-7.0, (1.0,9.0):-8.0, (2.0,0.0):2.0, (2.0,1.0):1.0, (2.0,2.0):0.0, (2.0,3.0):-1.0, (2.0,4.0):-2.0, (2.0,5.0):-3.0, (2.0,6.0):-4.0, (2.0,7.0):-5.0, (2.0,8.0):-6.0, (2.0,9.0):-7.0, (3.0,0.0):3.0, (3.0,1.0):2.0, (3.0,2.0):1.0, (3.0,3.0):0.0, (3.0,4.0):-1.0, (3.0,5.0):-2.0, (3.0,6.0):-3.0, (3.0,7.0):-4.0, (3.0,8.0):-5.0, (3.0,9.0):-6.0, (4.0,0.0):4.0, (4.0,1.0):3.0, (4.0,2.0):2.0, (4.0,3.0):1.0, (4.0,4.0):0.0, (4.0,5.0):-1.0, (4.0,6.0):-2.0, (4.0,7.0):-3.0, (4.0,8.0):-4.0, (4.0,9.0):-5.0, (5.0,0.0):5.0, (5.0,1.0):4.0, (5.0,2.0):3.0, (5.0,3.0):2.0, (5.0,4.0):1.0, (5.0,5.0):0.0, (5.0,6.0):-1.0, (5.0,7.0):-2.0, (5.0,8.0):-3.0, (5.0,9.0):-4.0, (6.0,0.0):6.0, (6.0,1.0):5.0, (6.0,2.0):4.0, (6.0,3.0):3.0, (6.0,4.0):2.0, (6.0,5.0):1.0, (6.0,6.0):0.0, (6.0,7.0):-1.0, (6.0,8.0):-2.0, (6.0,9.0):-3.0, (7.0,0.0):7.0, (7.0,1.0):6.0, (7.0,2.0):5.0, (7.0,3.0):4.0, (7.0,4.0):3.0, (7.0,5.0):2.0, (7.0,6.0):1.0, (7.0,7.0):0.0, (7.0,8.0):-1.0, (7.0,9.0):-2.0, (8.0,0.0):8.0, (8.0,1.0):7.0, (8.0,2.0):6.0, (8.0,3.0):5.0, (8.0,4.0):4.0, (8.0,5.0):3.0, (8.0,6.0):2.0, (8.0,7.0):1.0, (8.0,8.0):0.0, (8.0,9.0):-1.0, (9.0,0.0):9.0, (9.0,1.0):8.0, (9.0,2.0):7.0, (9.0,3.0):6.0, (9.0,4.0):5.0, (9.0,5.0):4.0, (9.0,6.0):3.0, (9.0,7.0):2.0, (9.0,8.0):1.0, (9.0,9.0):0.0, }
mul_dict = { (0.0,0.0):0.0, (0.0,1.0):0.0, (0.0,2.0):0.0, (0.0,3.0):0.0, (0.0,4.0):0.0, (0.0,5.0):0.0, (0.0,6.0):0.0, (0.0,7.0):0.0, (0.0,8.0):0.0, (0.0,9.0):0.0, (1.0,0.0):0.0, (1.0,1.0):1.0, (1.0,2.0):2.0, (1.0,3.0):3.0, (1.0,4.0):4.0, (1.0,5.0):5.0, (1.0,6.0):6.0, (1.0,7.0):7.0, (1.0,8.0):8.0, (1.0,9.0):9.0, (2.0,0.0):0.0, (2.0,1.0):2.0, (2.0,2.0):4.0, (2.0,3.0):6.0, (2.0,4.0):8.0, (2.0,5.0):10.0, (2.0,6.0):12.0, (2.0,7.0):14.0, (2.0,8.0):16.0, (2.0,9.0):18.0, (3.0,0.0):0.0, (3.0,1.0):3.0, (3.0,2.0):6.0, (3.0,3.0):9.0, (3.0,4.0):12.0, (3.0,5.0):15.0, (3.0,6.0):18.0, (3.0,7.0):21.0, (3.0,8.0):24.0, (3.0,9.0):27.0, (4.0,0.0):0.0, (4.0,1.0):4.0, (4.0,2.0):8.0, (4.0,3.0):12.0, (4.0,4.0):16.0, (4.0,5.0):20.0, (4.0,6.0):24.0, (4.0,7.0):28.0, (4.0,8.0):32.0, (4.0,9.0):36.0, (5.0,0.0):0.0, (5.0,1.0):5.0, (5.0,2.0):10.0, (5.0,3.0):15.0, (5.0,4.0):20.0, (5.0,5.0):25.0, (5.0,6.0):30.0, (5.0,7.0):35.0, (5.0,8.0):40.0, (5.0,9.0):45.0, (6.0,0.0):0.0, (6.0,1.0):6.0, (6.0,2.0):12.0, (6.0,3.0):18.0, (6.0,4.0):24.0, (6.0,5.0):30.0, (6.0,6.0):36.0, (6.0,7.0):42.0, (6.0,8.0):48.0, (6.0,9.0):54.0, (7.0,0.0):0.0, (7.0,1.0):7.0, (7.0,2.0):14.0, (7.0,3.0):21.0, (7.0,4.0):28.0, (7.0,5.0):35.0, (7.0,6.0):42.0, (7.0,7.0):49.0, (7.0,8.0):56.0, (7.0,9.0):63.0, (8.0,0.0):0.0, (8.0,1.0):8.0, (8.0,2.0):16.0, (8.0,3.0):24.0, (8.0,4.0):32.0, (8.0,5.0):40.0, (8.0,6.0):48.0, (8.0,7.0):56.0, (8.0,8.0):64.0, (8.0,9.0):72.0, (9.0,0.0):0.0, (9.0,1.0):9.0, (9.0,2.0):18.0, (9.0,3.0):27.0, (9.0,4.0):36.0, (9.0,5.0):45.0, (9.0,6.0):54.0, (9.0,7.0):63.0, (9.0,8.0):72.0, (9.0,9.0):81.0, }
div_dict = { (0.0,1.0):0.0, (0.0,2.0):0.0, (0.0,3.0):0.0, (0.0,4.0):0.0, (0.0,5.0):0.0, (0.0,6.0):0.0, (0.0,7.0):0.0, (0.0,8.0):0.0, (0.0,9.0):0.0, (1.0,1.0):1.0, (1.0,2.0):0.5, (1.0,3.0):0.3333333333333333, (1.0,4.0):0.25, (1.0,5.0):0.2, (1.0,6.0):0.16666666666666666, (1.0,7.0):0.14285714285714285, (1.0,8.0):0.125, (1.0,9.0):0.1111111111111111, (2.0,1.0):2.0, (2.0,2.0):1.0, (2.0,3.0):0.6666666666666666, (2.0,4.0):0.5, (2.0,5.0):0.4, (2.0,6.0):0.3333333333333333, (2.0,7.0):0.2857142857142857, (2.0,8.0):0.25, (2.0,9.0):0.2222222222222222, (3.0,1.0):3.0, (3.0,2.0):1.5, (3.0,3.0):1.0, (3.0,4.0):0.75, (3.0,5.0):0.6, (3.0,6.0):0.5, (3.0,7.0):0.42857142857142855, (3.0,8.0):0.375, (3.0,9.0):0.3333333333333333, (4.0,1.0):4.0, (4.0,2.0):2.0, (4.0,3.0):1.3333333333333333, (4.0,4.0):1.0, (4.0,5.0):0.8, (4.0,6.0):0.6666666666666666, (4.0,7.0):0.5714285714285714, (4.0,8.0):0.5, (4.0,9.0):0.4444444444444444, (5.0,1.0):5.0, (5.0,2.0):2.5, (5.0,3.0):1.6666666666666667, (5.0,4.0):1.25, (5.0,5.0):1.0, (5.0,6.0):0.8333333333333334, (5.0,7.0):0.7142857142857143, (5.0,8.0):0.625, (5.0,9.0):0.5555555555555556, (6.0,1.0):6.0, (6.0,2.0):3.0, (6.0,3.0):2.0, (6.0,4.0):1.5, (6.0,5.0):1.2, (6.0,6.0):1.0, (6.0,7.0):0.8571428571428571, (6.0,8.0):0.75, (6.0,9.0):0.6666666666666666, (7.0,1.0):7.0, (7.0,2.0):3.5, (7.0,3.0):2.3333333333333335, (7.0,4.0):1.75, (7.0,5.0):1.4, (7.0,6.0):1.1666666666666667, (7.0,7.0):1.0, (7.0,8.0):0.875, (7.0,9.0):0.7777777777777778, (8.0,1.0):8.0, (8.0,2.0):4.0, (8.0,3.0):2.6666666666666665, (8.0,4.0):2.0, (8.0,5.0):1.6, (8.0,6.0):1.3333333333333333, (8.0,7.0):1.1428571428571428, (8.0,8.0):1.0, (8.0,9.0):0.8888888888888888, (9.0,1.0):9.0, (9.0,2.0):4.5, (9.0,3.0):3.0, (9.0,4.0):2.25, (9.0,5.0):1.8, (9.0,6.0):1.5, (9.0,7.0):1.2857142857142858, (9.0,8.0):1.125, (9.0,9.0):1.0, }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment