Via this post, I found out about Russian Peasant Multiplication, a rather clever method of multiplication that only requires, doubling, halving and adding. So I wrote some code to display it: #!/usr/bin/python # -*- coding: utf-8 -*- import sys results=[] indicator=' ' left=int(sys.argv[1]) right=int(sys.argv[2]) while right >= 1: indicator='X' if right % 2: […]
↧