Addid a couple of fizz buzz programming problems

The programming grader still needs to be added, IDK where to do that.
This commit is contained in:
Brandon John 2017-02-11 23:06:26 -06:00
parent 76d1e52697
commit 595bed296d
8 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,25 @@
Write a program that outputs the numbers 1 through n, in incremental order, one per line.
However, replace any line that is a multiple of 3 with "Fizz" and any that are a multiple of 5 with "Buzz". Any line that is a multiple of 3 and 5 should be written as "FizzBuzz".
The input will be the number of lines to write, n, followed by a linebreak.
Sample output:
```
1
2
Fizz
4
Buzz
...
13
14
FizzBuzz
16
17
...
```

4
fizz-buzz-1/grader.py Normal file
View file

@ -0,0 +1,4 @@
def grade(random, key):
if key.find("PUT A NEW KEY HERE!!!!") != -1:
return True, "Correct!"
return False, "Nope."

5
fizz-buzz-1/problem.yml Normal file
View file

@ -0,0 +1,5 @@
title: Fizz Buzz 1
category: Programming
value: 10
author: wiresboy
autogen: false

1
fizz-buzz-1/todo.txt Normal file
View file

@ -0,0 +1 @@
I still need to do the graders.

View file

@ -0,0 +1,3 @@
Oh no! Two of my keys are broken! Please help me make the same Fzz Buzz program, sans that one letter and queston marks.
Also, please do not use `eval()`, `exec()`, etc.

4
fizz-buzz-2/grader.py Normal file
View file

@ -0,0 +1,4 @@
def grade(random, key):
if key.find("PUT A NEW KEY HERE!!!!") != -1:
return True, "Correct!"
return False, "Nope."

6
fizz-buzz-2/problem.yml Normal file
View file

@ -0,0 +1,6 @@
title: Fzz Buzz 2
category: Programming
value: 200
hint: Have fun!
author: wresboy
autogen: false

7
fizz-buzz-2/todo.txt Normal file
View file

@ -0,0 +1,7 @@
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 "?".`