Get rid of QR.
This commit is contained in:
parent
8b4e27d947
commit
d8b5b66298
5 changed files with 32 additions and 14 deletions
32
count.py
Normal file
32
count.py
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import yaml
|
||||||
|
import traceback
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
|
problem_names = os.listdir(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
problems = []
|
||||||
|
|
||||||
|
for problem_name in problem_names:
|
||||||
|
try:
|
||||||
|
metadata_file = os.path.dirname(os.path.abspath(__file__)) + os.sep + problem_name + os.sep + "problem.yml"
|
||||||
|
with open(metadata_file, "r") as f:
|
||||||
|
metadata_raw = f.read()
|
||||||
|
metadata = yaml.load(metadata_raw)
|
||||||
|
if "category" in metadata:
|
||||||
|
problems.append(metadata)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
# print traceback.format_exc()
|
||||||
|
|
||||||
|
print "Grand Total: %d" % len(problems)
|
||||||
|
print "Category Breakdown:"
|
||||||
|
|
||||||
|
c = Counter(map(lambda p: p.get("category", ""), problems))
|
||||||
|
categories = sorted(c.items(), key=lambda c: c[1], reverse=True)
|
||||||
|
for category, count in categories:
|
||||||
|
print " %s: %s" % (category, count)
|
||||||
|
for problem in problems:
|
||||||
|
if problem.get("category") != category: continue
|
||||||
|
print " %s" % problem.get("title")
|
|
@ -1 +0,0 @@
|
||||||
You know that cliché CTF problem where your QR code is missing a few pixels? Well guess what, we have a different [QR](${qr_png}) problem this year :D
|
|
|
@ -1,4 +0,0 @@
|
||||||
def grade(autogen, key):
|
|
||||||
if key.find("that_wasn't_so_hard_n0w_was_it?") != -1:
|
|
||||||
return True, "Yay! Now please tell me you didn't actually paint it . . ."
|
|
||||||
return False, "Nope!"
|
|
|
@ -1,9 +0,0 @@
|
||||||
author: usrv
|
|
||||||
title: QR
|
|
||||||
hint: There is a better way to do this problem than paint, but hey, your choice.
|
|
||||||
category: Forensics
|
|
||||||
autogen: false
|
|
||||||
programming: false
|
|
||||||
value: 50
|
|
||||||
files:
|
|
||||||
- qr.png
|
|
BIN
qr/qr.png
BIN
qr/qr.png
Binary file not shown.
Before Width: | Height: | Size: 86 KiB |
Loading…
Reference in a new issue