Advent of Code in Go and Zig (Day 6)

  Рет қаралды 64

lchampine

lchampine

Күн бұрын

Made it on the leaderboard! Not too shabby.
I solve AoC problems in Go first, and then port the solution to Zig after. The Zig section begins at 13:40.
All my solutions to AoC can be found here: github.com/luk...

Пікірлер: 4
@travisstaloch3688
@travisstaloch3688 4 жыл бұрын
in zig a ternary expression can look like: `return if (expression) 0 else 1;`. you had something like `return if (expression) 0; else 1;` with an added semicolon there.
@travisstaloch3688
@travisstaloch3688 4 жыл бұрын
zig builds in debug mode by default, so you don't have to pass any compiler flags to turn it on. i was a little surprised there were no warnings for printing an undefined. i found a pretty old issue for this. github.com/ziglang/zig/issues/211 . also found out that in safe builds (debug, release-safe) zig will init undefined values to 0xaaaa... which would be 2863311530 for 32 bits. maybe that was the value you saw printed out, can't remember.
@travisstaloch3688
@travisstaloch3688 4 жыл бұрын
maybe increase the editor font size twice if you can stand to look at it
@lchampine
@lchampine 4 жыл бұрын
good call, will do
Is Computer Science still worth it?
20:08
NeetCodeIO
Рет қаралды 263 М.
Advent of Code in Go and Zig (Day 9)
42:11
lchampine
Рет қаралды 82
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 44 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 22 МЛН
Поветкин заставил себя уважать!
01:00
МИНУС БАЛЛ
Рет қаралды 6 МЛН
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 71 М.
What is the Smallest Possible .EXE?
17:04
Inkbox
Рет қаралды 395 М.
Why More People Dont Use Linux
18:51
ThePrimeTime
Рет қаралды 230 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 228 М.
Object-Oriented Programming is Bad
44:35
Brian Will
Рет қаралды 2,3 МЛН
Nix explained from the ground up
23:39
Surma
Рет қаралды 30 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 459 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 395 М.
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 44 МЛН