let main = do:
printLn "Welcome."
name ← ask "What's your name?"
fmtLn "Hello there, {}!" name
going ← ask "How are you?"
switch (evaluateStatus going):
good: printLn "Wow, that's good to hear."
bad: printLn "I'm sorry to hear that."
neutral: printLn "It could be worse, you know."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fdisk -l /dev/sda | |
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disklabel type: dos | |
Disk identifier: 0x2c6ee985 | |
Device Boot Start End Sectors Size Id Type | |
/dev/sda1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/miles/Projects/trillek/tec/src/components/collision-body.cpp:66:11: warning: enumeration value 'SHAPE_NOT_SET' not handled in switch [-Wswitch] | |
/Users/miles/Projects/trillek/tec/include/game-state.hpp:50:14: warning: 13 enumeration values not handled in switch: 'COMPONENT_NOT_SET', 'kRenderable', 'kView'... [-Wswitch] | |
/Users/miles/Projects/trillek/tec/include/game-state.hpp:50:14: warning: 13 enumeration values not handled in switch: 'COMPONENT_NOT_SET', 'kRenderable', 'kView'... [-Wswitch] | |
/Users/miles/Projects/trillek/tec/src/resources/pixel-buffer.cpp:77:11: warning: enumeration values 'MONOCHROME', 'MONOCHROME_A', and 'UNKNOWN_MODE' not handled in switch [-Wswitch] | |
/Users/miles/Projects/trillek/tec/src/resources/pixel-buffer.cpp:101:11: warning: enumeration values 'MONOCHROME', 'MONOCHROME_A', and 'UNKNOWN_MODE' not handled in switch [-Wswitch] | |
/Users/miles/Projects/trillek/tec/include/game-state.hpp:50:14: warning: 13 enumeration values not handled in switch: 'COMPONENT_NOT_SET', 'kRenderable', 'k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def named_func(f): | |
return type('named_func', (), { | |
'__call__': lambda s, *a, **k: f(*a, **k), | |
'__repr__': lambda s: inspect.getsource(f), | |
'__str__': lambda s: f.__name__, | |
'__name__': f.__name__, | |
'__doc__': f.__doc__, | |
})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
def accumulate(accum_type): | |
def outer_wrapper(f): | |
@functools.wraps(f) | |
def inner_wrapper(*args, **kwds): | |
return accum_type(iter(f(*args, **kwds))) | |
return inner_wrapper | |
return outer_wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 3%] Building CXX object modules/trillek-vcomputer/CMakeFiles/VCOMPUTER_STATIC.dir/src/auxiliar.cpp.o | |
cd /Users/miles/Projects/trillek/tec/build2/modules/trillek-vcomputer && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DASIO_STANDALONE -DBT_USE_DOUBLE_PRECISION -DGLM_FORCE_PURE -I/Users/miles/Projects/trillek/tec -I/Users/miles/Projects/trillek/tec/modules/imgui -I/Users/miles/Projects/trillek/tec/include -I/Users/miles/Projects/trillek/tec/modules/spdlog/include -I/usr/local/include -I/Users/miles/Projects/trillek/tec/modules/selene/include -I/Users/miles/Projects/trillek/tec/modules/glfw3/include -I/Users/miles/Projects/trillek/tec/modules/glm -I/Users/miles/Projects/trillek/tec/modules/protobuf/src -I/Users/miles/Projects/trillek/tec/modules/bullet3/src -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenAL.framework/Headers -I/Users/miles/Projects/trillek/tec/modules/asio/asi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import random | |
import shutil | |
def safe_mkdir(*args, **kwds): | |
try: | |
return os.mkdir(*args, **kwds) | |
except FileExistsError: | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from copy import copy, deepcopy | |
import functools | |
import itertools | |
import operator | |
class Attribute(tuple): | |
pass | |
class Instance(tuple): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc(roll, miss, crit, dodge, parry, hit): | |
roll += hit | |
roll -= parry | |
if roll < 0.0: | |
return 'parry' | |
roll -= dodge | |
if roll < 0.0: | |
return 'dodge' | |
roll -= miss | |
if roll < 0.0: |