The Elves are constructing a lagoon to hold lava for a machine parts factory. The lagoon's perimeter is described by a series of directional instructions, each specifying a movement direction (Up, Down, Left, Right) and a length. The task is to determine the total volume of the lagoon that can be filled with lava, given these perimeter instructions.
In this challenge, the objective is to navigate a crucible filled with lava from the starting point to the destination within a city grid. Each block in the grid has a heat loss value, and the goal is to find the path that minimizes the total heat loss while adhering to specific movement rules.
- The crucible can move up to three blocks in a single direction but must turn 90 degrees left or right after moving three consecutive blocks.
- It can turn before completing three straight moves.
In this puzzle, we're tasked with simulating the behavior of a beam of light as it moves through a contraption in a cave. The contraption is a grid containing mirrors (/
and \
), splitters (|
and -
), and empty space (.
). The beam of light enters the grid from the top-left corner and moves according to these rules:
- Continues in the same direction in empty space (
.
). - Reflects 90 degrees when hitting a mirror (
/
or\
). - Passes through the pointy end of a splitter (
|
or-
) as if it were empty space. - Splits into two beams at the flat side of a splitter (
|
or-
), with each new beam going in the directions the splitter's pointy ends point.
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
# tmux config - a lot more orange | |
# yes, mouse, please | |
set -g mouse on | |
# use - for vertical pane and | for horizontal | |
# open new panes in currjnt working directory | |
# leave new windows to open in home | |
# unbind the original split keys | |
bind '-' split-window -c "#{pane_current_path}" |
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
<html> | |
<head> | |
<style> | |
body { | |
font-family: sans-serif; | |
font-size: 1.2rem; | |
} | |
table { | |
} | |
caption { |
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
#!/usr/bin/env bash | |
for x in {0..8}; do | |
for i in {30..37}; do | |
for a in {40..47}; do | |
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m " | |
done | |
echo | |
done | |
done |
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
const fs = require('fs'); | |
fs.readFile('./data/backfile.json', 'utf8', (err, data) => { | |
if (err) throw err; | |
const backup = JSON.parse(data); | |
processBackup(backup); | |
}); | |
function processBackup(backup) { | |
const posts = backup.db[0].data.posts; |
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
DaySuffix() { | |
case $(date +%d) in | |
01|21|31) echo "st";; | |
02|22) echo "nd";; | |
03|23) echo "rd";; | |
*) echo "th";; | |
esac | |
} | |
alias dailyfile="echo \"# $(date '+%A, %B %-d')$(DaySuffix), $(date '+%Y')\n\" > $(date '+%Y-%m-%d')-daily.md" |