Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
#!/usr/bin/env raku
use v6.*;
enum LogLevel <error warning info debug>;
class LogEvent {
has LogLevel $.level is required;
has Str $.message handles <gist Str>;
}
--- Part Two ---
The escalator doesn't move. The Elf explains that it probably needs more joltage to overcome the static friction of the system and hits the big red "joltage limit safety override" button. You lose count of the number of times she needs to confirm "yes, I'm sure" and decorate the lobby a bit while you wait.
Now, you need to make the largest joltage by turning on exactly twelve batteries within each bank.
The joltage output for the bank is still the number formed by the digits of the batteries you've turned on; the only difference is that now there will be 12 digits in each bank's joltage output instead of two.
Consider again the example from before:
--- Part Two ---
The clerk quickly discovers that there are still invalid IDs in the ranges in your list. Maybe the young Elf was doing other silly patterns as well?
Now, an ID is invalid if it is made only of some sequence of digits repeated at least twice. So, 12341234 (1234 two times), 123123123 (123 three times), 1212121212 (12 five times), and 1111111 (1 seven times) are all invalid IDs.
From the same example as before:
11-22 still has two invalid IDs, 11 and 22.
95-115 now has two invalid IDs, 99 and 111.
use v6.*;
my @input = "day3.input".IO.lines;
#my @input = [ "23191392", "14928318" ];
my $total = 0;
for @input.map(*.comb>>.Int) -> @i {
my ($idx,$first) = @i.max(:kv);
my $second;
#!/usr/bin/env raku
use v6.d;
my @input = "./day2.input".IO.slurp.split(',');
my $found-ids = SetHash.new;
my $running-total = 0;
for @input.map(*.split('-')) -> (Int() $start, Int() $end) {
print ".";
ID: for $start..$end -> $id {
compiling src/core/nativecall_libffi.o
src/core/nativecall_libffi.c: In function ‘MVM_nativecall_dispatch’:
src/core/nativecall_libffi.c:880:77: error: ‘num_args’ undeclared (first use in this function)
880 | ffi_status status = ffi_prep_cif(&cif, body->convention, (unsigned int)num_args, body->ffi_ret_type, body->ffi_arg_types);
| ^~~~~~~~
src/core/nativecall_libffi.c:880:77: note: each undeclared identifier is reported only once for each function it appears in
src/core/nativecall_libffi.c:888:13: error: redeclaration of ‘cif’ with no linkage
888 | ffi_cif cif;
| ^~~
src/core/nativecall_libffi.c:879:13: note: previous declaration of ‘cif’ with type ‘ffi_cif’
Test Summary Report
-------------------
t/spec/6.c/S04-declarations/my-6c.rakudo.moar (Wstat: 0 Tests: 112 Failed: 0)
TODO passed: 61
t/spec/APPENDICES/A02-some-day-maybe/misc.rakudo.moar (Wstat: 0 Tests: 6 Failed: 0)
TODO passed: 1
t/spec/MISC/misc.rakudo.moar (Wstat: 65280 (exited 255) Tests: 5 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 7 tests but ran 5.
t/spec/S02-literals/adverbs.rakudo.moar (Wstat: 0 Tests: 35 Failed: 0)
@ab5tract
ab5tract / not-parsed-right
Created November 19, 2025 18:17
Not parsed as RakuAST::Tyoe::Parameterized
# say q|Array[Int]|.AST;
RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::Type::Parameterized.new(
base-type => RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Array")
),
args => RakuAST::ArgList.new(
RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Int")
@ab5tract
ab5tract / gist:89fd81b1d5114c0d7557f5c1b70bd9f6
Last active November 12, 2025 17:36
it works fine until it doesn't
~/c/r/x/r/n/MoarVM (ab5tract/zig-support)> $RAKUPREFIX/bin/moar --version
This is MoarVM version 2025.10-12-g3aac34699 built with JIT support
~/c/r/x/r/n/MoarVM (ab5tract/zig-support)> cd ..
~/c/r/x/r/nqp (main)> make
+++ Preparing MOAR build directories
++++++ Building MOAR backend
+++ Generating gen/moar/stage1/MASTNodes.nqp
+++ Compiling gen/moar/stage1/MASTOps.moarvm
/home/longwalker/code/raku/z.misc/raku-prefix/bin/moar: error while loading shared libraries:
Projects
Recent Builds
Queue
More
Logout
Report: agent@1 [go_go_go] at 2025-10-29 16:50:46
report loading ...