Skip to content

Instantly share code, notes, and snippets.

View Smylers's full-sized avatar
🐄
bemused

Smylers Smylers

🐄
bemused
View GitHub Profile
#! /usr/bin/env raku
my $num = 17;
my @test = '317 1 17 4' xx 3;
@test[0] ~~ s/«$num»/XX/;
@test[1] ~~ s/..<?after «17»>/YY/;
@test[2] ~~ s/..<?after «$num»>/ZZ/;
.say for @test;
@Smylers
Smylers / 14_sample_grid
Created December 14, 2017 17:01
Advent of Code 2017 Day 14 Sample Grid
..#...#..#.....##..#.....##.####..#.#.##...#......#...##.#.###.###.#.....#.####.##..##.....#####.###..###....#.#.###.#.#.....###
###...#...#...#..#..#.#.##..#...##.####..#####....##.##.#.#.##....#..#....#..#....#.#.#..##...#.#...###....###.....###..#.####..
.####.#....#.#.#.#.###.###.##.###..#...#..#.######.#.#....######.###.#..#..####.#.##..####..#..#...##....#.#..#.....#....##.###.
.##..##..#.......######.#.#.###....#.##..#.##.#...##.....#..##......###..######...##....###.#...##.#.#....#..#..#..##.#......#..
####.##.......####.#.#.#...#....####.##.##.....##.##..#####.##...##.#..#.##.##....#.#..###..##.#.#..####.##...####..#.##.#.####.
#...##...######...##..#...#.#......##....######..#.####....#.....###..#.#..#.##.##.###..##...##....#....###.....#.##..#..#####..
..#........#..###.##....##.#.#......#.#.#.#...####.....##....##.#...##.##.#.#..#####.####.#..#......#....#######..#.#...#..#...#
.###....##.##.....#...#..##.##...#.#.##....##.#.#.##.##..##.###.####.......##....#####....#.#.#..#.####.#....##..#..###..
#! /usr/bin/perl
# See http://adventofcode.com/2016/day/10
#
# Takes the input filename as a command-line argument, or uses
# 10_input_bot_instructions by default.
#
# by Smylers https://twitter.com/Smylers2
@Smylers
Smylers / long_div_puzzle.txt
Created October 24, 2016 10:24
Martin Gardner's Long Division Puzzle
Diagram for Martin Gardner's long division puzzle, question 2 at:
https://www.theguardian.com/science/2016/oct/24/can-you-solve-it-two-tantalising-teasers-from-the-prince-of-puzzles
abcde
┏━━━━━━━━
fgh┃ijklmnop
-qrs↓↓↓↓
━━━━↓↓↓↓
tumn↓↓
-vwx↓↓
#! /usr/bin/perl
# number_puzzle_solver
#
# Given a target and a bunch of other numbers, find arithmetical expressions
# that use all the numbers to make the target.
use v5.14;
use warnings;