From 32832a1c821dcb1c4b33cebd3c0f9a732ceccca7 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 9 Sep 2016 16:13:22 -0500 Subject: [PATCH] Initial --- README.md | 3 ++ dijkstra/description.md | 22 ++++++++ dijkstra/dijkstra_map.svg | 108 ++++++++++++++++++++++++++++++++++++++ dijkstra/grader.py | 4 ++ dijkstra/problem.json | 12 +++++ survey/description.md | 1 + survey/problem.json | 12 +++++ 7 files changed, 162 insertions(+) create mode 100644 README.md create mode 100644 dijkstra/description.md create mode 100644 dijkstra/dijkstra_map.svg create mode 100644 dijkstra/grader.py create mode 100644 dijkstra/problem.json create mode 100644 survey/description.md create mode 100644 survey/problem.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7506e5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# EasyCTF 2016 + +Problems folder. Make a folder with your problem in it. Format coming soon... diff --git a/dijkstra/description.md b/dijkstra/description.md new file mode 100644 index 0000000..af775ba --- /dev/null +++ b/dijkstra/description.md @@ -0,0 +1,22 @@ +This is a high-level programming challenge. Given a set of vertices corresponding to the map below, your program must output the shortest path from `a` to `z`. + +![image](dijkstra_map.svg) + +The length of the line segments is randomized such that the length (`l`) satisfies `20 <= l <= 120`. + +Input will consist of 49 lines in the format `vertex1 vertex2 distanceBetween` + +Here are a few lines of example input: +```shell +h i 94 +h o 40 +i l 95 +l k 65 +l t 63 +t u 47 +``` + +The output should be written to a file named "dijkstra.out" in the current directory. Output will consist of the entire path, with `->` in between vertices. Print the current distance traveled in parenthesis after each vertex, as shown below. +``` +a -> b(113) -> c(210) -> f(262) -> h(291) -> i(326) -> m(381) -> s(409) -> x(444) -> y(534) -> z(557) +``` \ No newline at end of file diff --git a/dijkstra/dijkstra_map.svg b/dijkstra/dijkstra_map.svg new file mode 100644 index 0000000..5cc8600 --- /dev/null +++ b/dijkstra/dijkstra_map.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + +A +B +E +C +D +F +J +K +L + + + + +M +I +H +G + + + + + + + + + + + + +P +Q +R +X +Y +Z +V +U + +T +S +N +O +W + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start: ATarget: Z + diff --git a/dijkstra/grader.py b/dijkstra/grader.py new file mode 100644 index 0000000..59be45a --- /dev/null +++ b/dijkstra/grader.py @@ -0,0 +1,4 @@ +def grade(tid, answer): + if answer.find("edsger_wybe_dijkstra_was_a_happy_accident") != -1: + return { "correct": True, "message": "Great Job! That's a tough one." } + return { "correct": False, "message": "Nope, try again." } \ No newline at end of file diff --git a/dijkstra/problem.json b/dijkstra/problem.json new file mode 100644 index 0000000..95b4708 --- /dev/null +++ b/dijkstra/problem.json @@ -0,0 +1,12 @@ +{ + "pid": "dijkstra", + "title": "Dijkstra", + "hint": "You might consider reading up on shortest-path algorithms.", + "category": "Programming", + "autogen": false, + "programming": true, + "value": 450, + "bonus": 4, + "threshold": 0, + "weightmap": { } +} \ No newline at end of file diff --git a/survey/description.md b/survey/description.md new file mode 100644 index 0000000..e31e020 --- /dev/null +++ b/survey/description.md @@ -0,0 +1 @@ +Take our survey. \ No newline at end of file diff --git a/survey/problem.json b/survey/problem.json new file mode 100644 index 0000000..94ee4c8 --- /dev/null +++ b/survey/problem.json @@ -0,0 +1,12 @@ +{ + "pid": "survey", + "title": "Survey", + "hint": "No hint!", + "category": "Miscellaneous", + "autogen": false, + "programming": false, + "value": 20, + "bonus": 0, + "threshold": 0, + "weightmap": { } +}