From 595bed296d4929f1501fbb0b849315ba1f99d8dc Mon Sep 17 00:00:00 2001 From: Brandon John Date: Sat, 11 Feb 2017 23:06:26 -0600 Subject: [PATCH] Addid a couple of `fizz buzz` programming problems The programming grader still needs to be added, IDK where to do that. --- fizz-buzz-1/description.md | 25 +++++++++++++++++++++++++ fizz-buzz-1/grader.py | 4 ++++ fizz-buzz-1/problem.yml | 5 +++++ fizz-buzz-1/todo.txt | 1 + fizz-buzz-2/description.md | 3 +++ fizz-buzz-2/grader.py | 4 ++++ fizz-buzz-2/problem.yml | 6 ++++++ fizz-buzz-2/todo.txt | 7 +++++++ 8 files changed, 55 insertions(+) create mode 100644 fizz-buzz-1/description.md create mode 100644 fizz-buzz-1/grader.py create mode 100644 fizz-buzz-1/problem.yml create mode 100644 fizz-buzz-1/todo.txt create mode 100644 fizz-buzz-2/description.md create mode 100644 fizz-buzz-2/grader.py create mode 100644 fizz-buzz-2/problem.yml create mode 100644 fizz-buzz-2/todo.txt diff --git a/fizz-buzz-1/description.md b/fizz-buzz-1/description.md new file mode 100644 index 0000000..3eac10a --- /dev/null +++ b/fizz-buzz-1/description.md @@ -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 + +... +``` \ No newline at end of file diff --git a/fizz-buzz-1/grader.py b/fizz-buzz-1/grader.py new file mode 100644 index 0000000..d5a341a --- /dev/null +++ b/fizz-buzz-1/grader.py @@ -0,0 +1,4 @@ +def grade(random, key): + if key.find("PUT A NEW KEY HERE!!!!") != -1: + return True, "Correct!" + return False, "Nope." \ No newline at end of file diff --git a/fizz-buzz-1/problem.yml b/fizz-buzz-1/problem.yml new file mode 100644 index 0000000..5642a7c --- /dev/null +++ b/fizz-buzz-1/problem.yml @@ -0,0 +1,5 @@ +title: Fizz Buzz 1 +category: Programming +value: 10 +author: wiresboy +autogen: false \ No newline at end of file diff --git a/fizz-buzz-1/todo.txt b/fizz-buzz-1/todo.txt new file mode 100644 index 0000000..8a61e42 --- /dev/null +++ b/fizz-buzz-1/todo.txt @@ -0,0 +1 @@ +I still need to do the graders. \ No newline at end of file diff --git a/fizz-buzz-2/description.md b/fizz-buzz-2/description.md new file mode 100644 index 0000000..e9ae352 --- /dev/null +++ b/fizz-buzz-2/description.md @@ -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. \ No newline at end of file diff --git a/fizz-buzz-2/grader.py b/fizz-buzz-2/grader.py new file mode 100644 index 0000000..d5a341a --- /dev/null +++ b/fizz-buzz-2/grader.py @@ -0,0 +1,4 @@ +def grade(random, key): + if key.find("PUT A NEW KEY HERE!!!!") != -1: + return True, "Correct!" + return False, "Nope." \ No newline at end of file diff --git a/fizz-buzz-2/problem.yml b/fizz-buzz-2/problem.yml new file mode 100644 index 0000000..aae317d --- /dev/null +++ b/fizz-buzz-2/problem.yml @@ -0,0 +1,6 @@ +title: Fzz Buzz 2 +category: Programming +value: 200 +hint: Have fun! +author: wresboy +autogen: false \ No newline at end of file diff --git a/fizz-buzz-2/todo.txt b/fizz-buzz-2/todo.txt new file mode 100644 index 0000000..cce9b1e --- /dev/null +++ b/fizz-buzz-2/todo.txt @@ -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 "?".` \ No newline at end of file