one-file-projects/fizzbuzz.py
2014-08-31 06:14:41 +02:00

21 lines
368 B
Python

a = [ 3,0,0,1,0,2,1,0,0,1,2,0,1,0,0 ]
b = [ "%d\n", "Fizz\n", "Buzz\n", "FizzBuzz\n" ]
boff = [ 0 for z in b ]
for i in range(len(b)):
boff[i] = 0
for j in range(i):
boff[i] += len(b[j])
s = ""
for i in range(len(a)):
s += "\\x%x" % (a[i]+len(a)+boff[a[i]])
for n in b:
for c in n:
s += "\\x%x" % (ord(c))
s += "\\x0"
print s