Gynvael’s Mission 15 (en): A writeup by Chris Warrick
(Spoilers ahead!)
I started solving the mission by opening the chart with GIMP and measuring the first few lines. I found out that the first red bars are:
60 63 112 104 112 10 10
#!/usr/bin/env python3 | |
from __future__ import print_function | |
import sys | |
import datetime | |
try: | |
import babel.dates | |
except ImportError: | |
print("Failed to import Babel. Did you run `pip install Babel`?") | |
sys.exit(1) |
Homebrew build logs for macvim on macOS 10.13.4 | |
Build date: 2018-04-16 21:57:32 |
import socket | |
s1 = socket.socket() | |
s2 = socket.socket() | |
s1.bind(('0.0.0.0', 1234)) | |
s2.bind(('0.0.0.0', 1234)) | |
# Traceback (most recent call last): | |
# File "socket_in_use.py", line 4, in <module> | |
# s1.bind(('0.0.0.0', 1234)) | |
# OSError: [Errno 48] Address already in use |
(Spoilers ahead!)
I started solving the mission by opening the chart with GIMP and measuring the first few lines. I found out that the first red bars are:
60 63 112 104 112 10 10
def sep_unique(d): | |
newdict = {} | |
for key, val in d.items(): | |
if len(val) > 1: | |
for n, i in enumerate(val, 1): | |
newdict[key if n == 1 else f"{key}{i}"] = i | |
else: | |
newdict[key] = val[0] | |
return newdict | |
if 1 == 1: | |
pass | |
elif 1 == 1 or \ | |
1 == 2: # backslash continuation is very ugly | |
pass | |
elif (1 == 1 or # parentheses work better | |
1 == 2): | |
pass | |
elif (1 == 1 or # and they look best with 8 spaces | |
1 == 2): |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <sys/resource.h> | |
#define MSIZE 10000 | |
int main() { | |
int* a[MSIZE]; | |
struct rusage usage; |
from typing import Dict, Union, NewType | |
Foo = NewType("Foo", str) | |
Bar = NewType("Bar", int) | |
def get_data() -> Dict[str, Union[Foo, Bar]]: | |
return {"foo": Foo("one"), "bar": Bar(2)} | |
def process(foo_value: Foo, bar_value: Bar) -> None: | |
pass |
# https://eclecticlight.co/2017/04/06/apfs-is-currently-unusable-with-most-non-english-languages/ | |
# ↑ is bullshit | |
In [1]: e = 'é' | |
In [2]: len(e) | |
Out[2]: 1 | |
In [3]: import unicodedata |
def ask_int(question): | |
"""Ask a question and return an integer.""" | |
while True: | |
try: | |
return int(input(question)) | |
except ValueError: | |
print("Not a number, please try again.") |