Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/puzzle.py
blob: 6a3b067399534691706263ec796159ffbd892dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

class Puzzle:
	
	class Topic:
		def __init__(self, new):
			self.name = new
	class Difficulty:
		def __init__(self, new):
			self.name = new
	
	def __init__(self, archivo):
		try:
			dic = {}
			exec(open(archivo).read(), dic)
			self.question = dic['question']
			self.answer = dic['answer']
			self.topic = Topic(dic['topic'])
			self.difficulty = Difficulty(dic['difficulty'])
			self.score = int(dic['score'])
		except:
			print "Error"