Implemented fizzbuzz graders, updated values
This commit is contained in:
parent
6a6820ed63
commit
73c78ce453
8 changed files with 60 additions and 25 deletions
7
fizz-buzz-1/generator.py
Normal file
7
fizz-buzz-1/generator.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
test_case = raw_input()
|
||||
if test_case == "1":
|
||||
print "42"
|
||||
if test_case == "2":
|
||||
print "97"
|
||||
if test_case == "3":
|
||||
print "128"
|
|
@ -1,12 +1,11 @@
|
|||
n = input()
|
||||
n = int(raw_input())
|
||||
|
||||
for i in range(1, n + 1):
|
||||
if i % 3 == 0 and i % 5 == 0:
|
||||
print 'FizzBuzz'
|
||||
elif i % 3 == 0:
|
||||
print 'Fizz'
|
||||
elif i % 5 == 0:
|
||||
print 'Buzz'
|
||||
else:
|
||||
print i
|
||||
|
||||
if i % 3 == 0 and i % 5 == 0:
|
||||
print 'FizzBuzz'
|
||||
elif i % 3 == 0:
|
||||
print 'Fizz'
|
||||
elif i % 5 == 0:
|
||||
print 'Buzz'
|
||||
else:
|
||||
print i
|
|
@ -1,5 +1,11 @@
|
|||
title: Fizz Buzz 1
|
||||
category: Programming
|
||||
value: 30
|
||||
value: 50
|
||||
author: wiresboy
|
||||
autogen: false
|
||||
autogen: false
|
||||
programming: true
|
||||
|
||||
grader_language: python
|
||||
test_cases: 3
|
||||
time_limit: 500
|
||||
memory_limit: 256000
|
|
@ -1 +0,0 @@
|
|||
I still need to do the graders.
|
17
fizz-buzz-2/generator.py
Normal file
17
fizz-buzz-2/generator.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
test_case = raw_input()
|
||||
if test_case == "1":
|
||||
print "27"
|
||||
if test_case == "2":
|
||||
print "31"
|
||||
if test_case == "3":
|
||||
print "42"
|
||||
if test_case == "4":
|
||||
print "72"
|
||||
if test_case == "5":
|
||||
print "81"
|
||||
if test_case == "6":
|
||||
print "99"
|
||||
if test_case == "7":
|
||||
print "128"
|
||||
if test_case == "8":
|
||||
print "141"
|
|
@ -1,4 +1,11 @@
|
|||
def grade(random, key):
|
||||
if key.find("PUT A NEW KEY HERE!!!!") != -1:
|
||||
return True, "Correct!"
|
||||
return False, "Nope."
|
||||
n = int(raw_input())
|
||||
|
||||
for i in range(1, n + 1):
|
||||
if i % 3 == 0 and i % 5 == 0:
|
||||
print 'FizzBuzz'
|
||||
elif i % 3 == 0:
|
||||
print 'Fizz'
|
||||
elif i % 5 == 0:
|
||||
print 'Buzz'
|
||||
else:
|
||||
print i
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
title: Fzz Buzz 2
|
||||
category: Programming
|
||||
value: 200
|
||||
value: 350
|
||||
hint: Have fun!
|
||||
author: wresboy
|
||||
autogen: false
|
||||
autogen: false
|
||||
programming: true
|
||||
|
||||
grader_language: python
|
||||
test_cases: 8
|
||||
time_limit: 1000
|
||||
memory_limit: 256000
|
|
@ -1,7 +1 @@
|
|||
I still need to do the execution grader, and probably introduce some sort of limits to prevent the contestant from having a print "1,2,fizz,4,buzz..." type program. A length limit would probably be sufficient.
|
||||
|
||||
I also need to add a program validator, that checks for the characters "i", "I", and "?".
|
||||
|
||||
We will need to disable "eval()", "exec()", globals (in python), etc.
|
||||
|
||||
Backup hint: `Don't use the characters "i", "I", and "?".`
|
Loading…
Reference in a new issue