This commit is contained in:
Michael Zhang 2016-09-09 16:13:22 -05:00
commit 32832a1c82
7 changed files with 162 additions and 0 deletions

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# EasyCTF 2016
Problems folder. Make a folder with your problem in it. Format coming soon...

22
dijkstra/description.md Normal file
View file

@ -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)
```

108
dijkstra/dijkstra_map.svg Normal file
View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1280px" height="800px" viewBox="0 0 1280 800" enable-background="new 0 0 1280 800" xml:space="preserve">
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="151.5" cy="127.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="288.5" cy="231.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="315.5" cy="86.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="486.5" cy="86.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="486.5" cy="215.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="198.5" cy="385.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="392.5" cy="363.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="361.5" cy="511.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="498.5" cy="556.5" r="30.5"/>
<text transform="matrix(1 0 0 1 139 141)" font-family="'Consolas'" font-size="45">A</text>
<text transform="matrix(1 0 0 1 303.5 101.5)" font-family="'Consolas'" font-size="45">B</text>
<text transform="matrix(1 0 0 1 475 100)" font-family="'Consolas'" font-size="45">E</text>
<text transform="matrix(1 0 0 1 275 245)" font-family="'Consolas'" font-size="45">C</text>
<text transform="matrix(1 0 0 1 189 400)" font-family="'Consolas'" font-size="45">D</text>
<text transform="matrix(1 0 0 1 476 229.5)" font-family="'Consolas'" font-size="45">F</text>
<text transform="matrix(1 0 0 1 381 379)" font-family="'Consolas'" font-size="45">J</text>
<text transform="matrix(1 0 0 1 350.5 525.5)" font-family="'Consolas'" font-size="45">K</text>
<text transform="matrix(1 0 0 1 487.5 570.5)" font-family="'Consolas'" font-size="45">L</text>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="621.5" cy="446.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="524.5" cy="363.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="639.5" cy="238.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="662.5" cy="86.5" r="30.5"/>
<text transform="matrix(1 0 0 1 609 462)" font-family="'Consolas'" font-size="45">M</text>
<text transform="matrix(1 0 0 1 513 379)" font-family="'Consolas'" font-size="45">I</text>
<text transform="matrix(1 0 0 1 628 254)" font-family="'Consolas'" font-size="45">H</text>
<text transform="matrix(1 0 0 1 648.5 100.5)" font-family="'Consolas'" font-size="45">G</text>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="791.5" cy="116.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="911.5" cy="184.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="977.5" cy="284.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="984.5" cy="416.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="1125.5" cy="470.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="984.5" cy="649.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="890.5" cy="531.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="632.5" cy="704.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="792.5" cy="680.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="761.5" cy="481.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="768.5" cy="345.5" r="30.5"/>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="786.5" cy="238.5" r="30.5"/>
<text transform="matrix(1 0 0 1 782 132)" font-family="'Consolas'" font-size="45">P</text>
<text transform="matrix(1 0 0 1 899.5 195.5)" font-family="'Consolas'" font-size="45">Q</text>
<text transform="matrix(1 0 0 1 968 300)" font-family="'Consolas'" font-size="45">R</text>
<text transform="matrix(1 0 0 1 973 431)" font-family="'Consolas'" font-size="45">X</text>
<text transform="matrix(1 0 0 1 1113 487)" font-family="'Consolas'" font-size="45">Y</text>
<text transform="matrix(1 0 0 1 973 665)" font-family="'Consolas'" font-size="45">Z</text>
<text transform="matrix(1 0 0 1 779.5 696.5)" font-family="'Consolas'" font-size="45">V</text>
<text transform="matrix(1 0 0 1 621 718.5)" font-family="'Consolas'" font-size="45">U</text>
<circle fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" cx="639.5" cy="572.5" r="30.5"/>
<text transform="matrix(1 0 0 1 628 589)" font-family="'Consolas'" font-size="45">T</text>
<text transform="matrix(1 0 0 1 750 495)" font-family="'Consolas'" font-size="45">S</text>
<text transform="matrix(1 0 0 1 756 362.5)" font-family="'Consolas'" font-size="45">N</text>
<text transform="matrix(1 0 0 1 775 254)" font-family="'Consolas'" font-size="45">O</text>
<text transform="matrix(1 0 0 1 878 548)" font-family="'Consolas'" font-size="45">W</text>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="179.947" y1="116.5" x2="286.856" y2="97"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="315.5" y1="117" x2="298" y2="201"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="275" y1="258.851" x2="218.519" y2="362.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="309.088" y1="254" x2="371.909" y2="341.002"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="229" y1="385.5" x2="364.677" y2="376"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="392.5" y1="394" x2="361.5" y2="481"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="423" y1="363.5" x2="494" y2="363.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="486.5" y1="246" x2="524.5" y2="333"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="405.12" y1="335.735" x2="460.534" y2="231.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="319" y1="231.5" x2="456" y2="215.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="346" y1="86.5" x2="456" y2="86.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="486.5" y1="117" x2="486.5" y2="185"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="517" y1="86.5" x2="632" y2="86.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="693" y1="86.5" x2="761" y2="116.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="662.5" y1="117" x2="639.5" y2="208"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="517" y1="215.5" x2="609" y2="238.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="549.118" y1="345.5" x2="621.5" y2="263.118"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="665.766" y1="254" x2="746.479" y2="324.41"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="648.5" y1="432.315" x2="743.175" y2="362.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="545.612" y1="385.5" x2="598.59" y2="426.377"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="524.5" y1="394" x2="498.5" y2="526"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="391.064" y1="519.015" x2="471.662" y2="542"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="529" y1="556.5" x2="609" y2="572.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="639.5" y1="603" x2="632.5" y2="674"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="663" y1="704.5" x2="762" y2="680.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="666.338" y1="587" x2="768.5" y2="661.69"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="665.466" y1="556.5" x2="738" y2="500.941"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="766.977" y1="511.5" x2="786.5" y2="650"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="792" y1="481.5" x2="867.051" y2="512"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="916.146" y1="548" x2="967.256" y2="624.346"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="823" y1="680.5" x2="954" y2="649.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="873.038" y1="556.5" x2="808.357" y2="654.442"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="621.5" y1="477" x2="639.5" y2="542"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="648.851" y1="460" x2="733.053" y2="470.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="768.5" y1="376" x2="761.5" y2="451"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="786.5" y1="269" x2="768.5" y2="315"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="670" y1="238.5" x2="756" y2="238.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="791.5" y1="147" x2="786.5" y2="208"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="819.947" y1="127.5" x2="888.5" y2="164.481"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="796.319" y1="333" x2="892.059" y2="208"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="799" y1="345.5" x2="947" y2="284.5"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="937.146" y1="201" x2="967.256" y2="255.769"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="977.5" y1="315" x2="984.5" y2="386"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="786.5" y1="464.038" x2="958.507" y2="308.355"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="789.947" y1="470.5" x2="954.52" y2="422.086"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="1013.355" y1="426.377" x2="1098.524" y2="456.269"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="1113" y1="498.319" x2="1008" y2="630.059"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="916.146" y1="515" x2="1095.701" y2="477"/>
<line fill="none" stroke="#000000" stroke-width="5" stroke-miterlimit="10" x1="903.575" y1="503.94" x2="965.059" y2="440"/>
<text transform="matrix(1 0 0 1 112 638.5)"><tspan x="0" y="0" font-family="'Consolas'" font-size="38"> Start:</tspan><tspan x="146.248" y="0" font-family="'Consolas'" font-size="38" letter-spacing="12"> </tspan><tspan x="180" y="0" font-family="'Consolas'" font-size="38">A</tspan><tspan x="0" y="45.6" font-family="'Consolas'" font-size="38">Target:</tspan><tspan x="146.248" y="45.6" font-family="'Consolas'" font-size="38" letter-spacing="12"> </tspan><tspan x="180" y="45.6" font-family="'Consolas'" font-size="38">Z</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

4
dijkstra/grader.py Normal file
View file

@ -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." }

12
dijkstra/problem.json Normal file
View file

@ -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": { }
}

1
survey/description.md Normal file
View file

@ -0,0 +1 @@
Take our survey.

12
survey/problem.json Normal file
View file

@ -0,0 +1,12 @@
{
"pid": "survey",
"title": "Survey",
"hint": "No hint!",
"category": "Miscellaneous",
"autogen": false,
"programming": false,
"value": 20,
"bonus": 0,
"threshold": 0,
"weightmap": { }
}