euclid.py 1.08 KB
Newer Older
1
from questionman import Questionman
Constantin Berhard's avatar
Constantin Berhard committed
2

3
class Euclid(Questionman):
Constantin Berhard's avatar
Constantin Berhard committed
4 5
	questions = [
		("Imagine there is a circle. The origin and the point (4,0) are on the circle. The circle is symmetric with respect to the line x=y. Where is its center? ", lambda x: "2,2" in ("".join(x.split())).strip("()[]{}")),
6 7 8 9 10
		("In a rectangular triangle, if the two shortest sides have lengths 3 meters and 4 meters, how long is the longest side?", lambda x: "5m" in ("".join(x.split())).replace("meters","m").replace("meter","m")),
		("What is the fifth decimal digit of π?",lambda x: "9" == "".join(list(filter(lambda x:x.isdigit(),x)))),
		("What is the determinant of the following matrix?\n/ 2  0 \\\n\\ 3  4 /",lambda x: "8" == "".join(list(filter(lambda x:x.isdigit(),x)))),
		("How many bytes are there in a MiB?",lambda x: "1048576" == "".join(list(filter(lambda x:x.isdigit(),x)))),
		("What does a mine turtle have on its back?",lambda x: "button" in x.lower() or "trigger" in x.lower()),
Constantin Berhard's avatar
Constantin Berhard committed
11 12 13
		]
	
	def __init__(self,game):
14
		super().__init__(game)
Constantin Berhard's avatar
Constantin Berhard committed
15 16 17 18 19
	
	def __str__ (self):
		return "Euclid"
	
	def __repr__ (self):
20
		return "E"