This is a maze game, implemented in four phases:
- The player (
U
) can move around in the maze. - The player can move the walls (
#
) of the maze. - Trolls spawn (
T
) who seek the player and move a wall when the player does. - Each game generates a maze.
#!/bin/bash | |
DIR=$( pwd ) | |
CLASSES=$( find -name '*.class' -print ) | |
for file in $CLASSES; do | |
filedir=$( dirname $file ) | |
filename=$( basename $file | sed s/.class// ) | |
echo Changing to $filedir | |
cd $filedir | |
echo Executing $filename |
#!/bin/bash | |
# | |
# This is free and unencumbered software released into the public domain. | |
# | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# | |
# In jurisdictions that recognize copyright laws, the author or authors |
options iwlwifi 11n_disable=1 | |
options iwlwifi swcrypto=1 |
; Given a list of "passwords" for which e.g. "abc" and "cba" or "cat" and "tac" | |
; are not considered unique but "abc" and "bac" are considered unique, count the | |
; unique words in the list. | |
; | |
; Run it like this: `clojure 2.clj < words.txt` | |
(require 'clojure.string) |
#!/usr/bin/env python3 | |
# Given a list of "passwords" for which e.g. "abc" and "cba" or "cat" and "tac" | |
# are not considered unique but "abc" and "bac" are considered unique, count the | |
# unique words in the list. | |
# | |
# Usage: python3 2.py < words.txt | |
import sys | |
from collections.abc import Set |
# Given a 32-bit decimal number, convert it to binary, reverse it, then print | |
# the reversed version in decimal. | |
def solution(n): | |
result = 0 | |
for i in range(32): | |
result |= ((n >> i) & 1) << (31 - i) | |
return result |
# Implement a queue with 2 stacks . Your queue should have an enqueue and a | |
# dequeue function and it should be "first in first out" (FIFO). | |
# | |
# Optimize for the time cost of mmm function calls on your queue. These can be | |
# any mix of enqueue and dequeue calls. | |
# | |
# Assume you already have a stack implementation and it gives O(1) | |
# time push and pop. | |
class Stack(list): |
OPENOCD ?= /usr/bin/openocd/ | |
OPENOCD_SCRIPTS ?= /usr/share/openocd/scripts | |
openocd: $(ELF) | |
$(OPENOCD) -s $(OPENOCD_SCRIPTS) \ | |
-f interface/stlink-v2-1.cfg \ | |
-f target/stm32l4x.cfg \ | |
-c "telnet_port 4444" \ | |
-c "gdb_port 3333" |