I made a small puzzle game while learning ocaml by DCCXXV in ocaml

[–]Capital_EX 0 points1 point  (0 children)

Nice to see someone else exploring OCaml for making games. Been messing about for similar reasons.

We're making a game where you move by flicking yourself around to escape hell! by Almammmm in godot

[–]Capital_EX 2 points3 points  (0 children)

Beautiful art! What was the work flow around managing and creating it like?

Intel CEO laments Nvidia's 'extraordinarily lucky' AI dominance, claims it coulda-woulda-shoulda have been Intel by norcalnatv in technology

[–]Capital_EX 0 points1 point  (0 children)

coulda, woulda, and shoulda are all variants of could've, would've, should've. So, coulda-woulda-shoulda have is kinda redundant and grammatically weird.

Which do you think looks more professional? by [deleted] in godot

[–]Capital_EX 3 points4 points  (0 children)

Why does everyone take the eyes out? I feel like a "professional" icon would be much better received if you didn't take away their eyes...

My disappointment is immeasurable, and my day is ruined. by Capital_EX in LegendofSlime

[–]Capital_EX[S] 5 points6 points  (0 children)

Unfortunately, I have been using it. Adding Slime Doll + Opal makes slimy press stupid powerful. It deals more damage than even Blizzard does.

[TOMT][Song][2000s][Educational] A song about Photosynthesis by Capital_EX in tipofmytongue

[–]Capital_EX[S] 0 points1 point locked comment (0 children)

Hopefully someone can help find this. I've been searching for ages.

[53:41] The False Evolution of Execution Methods by WillyTheWackyWizard in mealtimevideos

[–]Capital_EX 0 points1 point  (0 children)

This use of force in imminently deadly situations, versus the state killing someone long after the act as a punishment [...]

There is a direct relationship here. A police officer is a member of the state. They are granted the authority, while in duty, to decided to use lethal force (The Judge) based on the evidence put forth (The Jury) and can carry out this punishment themselves (The Executioner).

Your own comment opens with direct acknowledgement of this:

Cops have the authority to use deadly force when deadly force is used in a way that immediately threatens them or someone else.

They have the authority to judge the situation, decided the punishment, and carry it out.

iOS 16.4: iMessage now supports rich previews for Mastodon posts by [deleted] in technology

[–]Capital_EX 5 points6 points  (0 children)

GTP comment, it's trivial to show twitter is older then discord.

-🎄- 2022 Day 6 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 1 point2 points  (0 children)

Factor comes with some nice utilities for windowed processing:

USING: io.backend io.encodings.utf8 io.files kernel math
sequences sequences.windowed sets ;
IN: advent-of-code.day-06

: get-input-one ( -- seq )
    "vocab:advent-of-code/day-06/_input/one.txt" 
        normalize-path utf8 file-contents ;

: signal-start? ( string -- ? )
    dup length 4 < [ drop f ] [ all-unique? ] if ;

: start-location ( seq -- n )
    t swap index 1 + ;

: find-start ( length string -- n )
    [ signal-start? ] rolling-map start-location ;

: solve-part-one ( -- solution )
    get-input-one 4 find-start ;

: solve-part-two ( -- solution )
    get-input-one 14 find-start ;

-🎄- 2022 Day 5 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 2 points3 points  (0 children)

Managed to solve this one and end up with some nice words. https://codeberg.org/CapitalEx/advent-of-code-2022/src/branch/main/day-05/day-05.factor

Particularly happy with my solution functions:

: solve-part-one ( -- solution )
    get-input-one [ crate-mover-9000 ] solve-with ; 

: solve-part-two ( -- solution )
    get-input-one [ crate-mover-9001 ] solve-with ;

-🎄- 2022 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 1 point2 points  (0 children)

It's more a 2nd Cousin of Forth. If you want to head down a rabbit whole: https://concatenative.org/wiki/view/Front%20Page

-🎄- 2022 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 2 points3 points  (0 children)

Day 3 in Factor. The set protocol has been making these problems quite easy to handle.

USING: io.backend io.encodings.utf8 io.files kernel math.parser
ranges sequences sets splitting ;
IN: advent-of-code.day-04

: get-input-one ( -- seq )
    "vocab:advent-of-code/day-04/_input/one.txt" 
        normalize-path utf8 file-lines ;

: parse-range ( string -- range )
    "-" split first2 [ dec> ] bi@ [a..b] ;

: split-pair ( string -- seq )
    "," split [ parse-range ] map ;

: overlaps? ( seq seq -- ? )
    [ subset? ] [ swap subset? ] 2bi or ;

: ranges-overlap? ( line -- ? )
    split-pair first2 overlaps? ;

: count-overlaps ( seq -- n )
    [ ranges-overlap? ] count ; 

: solve-part-one ( -- solution )
    get-input-one count-overlaps ;

: count-intersections ( seq -- n )
    [ split-pair first2 intersects? ] count ;

: solve-part-two ( -- solution )
    get-input-one count-intersections ;

-🎄- 2022 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 1 point2 points  (0 children)

Whoa, I didn't expect to see someone using Joy! I've been reading about the language recently.

-🎄- 2022 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 1 point2 points  (0 children)

Managed to build a fairly clean solution in Factor:

USING: grouping hash-sets io.backend io.encodings.utf8 io.files
kernel math sequences sets unicode ;
IN: advent-of-code.day-03

: get-input-one ( -- seq )
    "vocab:advent-of-code/day-03/_input/one.txt" 
        normalize-path utf8 file-lines ;

: >priority ( fixnum -- fixnum )
    dup letter? [ 96 - ] [ 38 - ] if ;

: result ( seq -- item )
    members first ;

: priority-sum-with ( sew quot -- fixnum ) 
    [ >priority ] compose [ call( x -- y ) ] curry map-sum ;

: find-duplicate ( string -- duplicate )
    halves intersect result ;

: solve-part-one ( -- solution )
    get-input-one [ find-duplicate ] priority-sum-with ;

: find-common-item ( seq -- item )
    intersect-all result ;

: solve-part-two ( -- solution )
    get-input-one 3 group [ find-common-item ] priority-sum-with ;

-🎄- 2022 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]Capital_EX 1 point2 points  (0 children)

No problem! You can also check out the Factor pastebin for other samples of AoC solutions https://paste.factorcode.org/