Profanity filter test - programming.dev

Fuck

Everybody Codes: Melody Made of Code - Quest 1

https://lemmy.world/post/43848655

Everybody Codes: Melody Made of Code - Quest 1 - Lemmy.World

# Quest 1: Scales, Bags and a Bit of a Mess * Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever) * You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ [https://topaz.github.io/paste/] if you prefer sending it through a URL

Some serious health problems are messing with #Forth and #Advent_of_code plans. I was already moving slow but now I find that I can't work the problems and learn Forth at the same time. I love how the language works (OG assembly guy) but I can't make the jump from "writing words" to "writing phrases" of code--real programming requires phrases and then sentences.

I'm tired of Pascal, Go does little for me and often annoys me (all loops are "for", really?). I could pick up Scheme again but I don't trust that I'll have the capacity to move from phrases back to sentences.

Out on eBay I saw some old books that I liked at the time--the #BASIC era. One of them was a book I regretted losing in move (BASIC With Style). They are ordered and I've dusted off #QB64. I was more of a boot to Basic guy myself, but I can deal with QBasic style.

It's chicken soup for the ill programmers soul. Easy peasy comfort coding while enduring treatment.

https://qb64phoenix.com/qb64wiki/index.php/Main_Page. QB64PhoenixEdition

In spite of it being the end times and problems with health, I continue to chip away at learning #Forth #Programming for #Advent_of_code. I'm finally learning to more aggressively factor out code (hint: if you want local variables or need >R, stop it). It's functional decomposition taken further than one might in a traditional language. Here's a silly example:

Trying to convert a string to all one case in one definition is (for me) something out of Lovecraft. Fortunately the problem breaks down into three obvious operations (using lower case as an example):

Convert a single character to lower case.
Convert the current character in a string to lower case and move to the next character.
Iterate over the characters in a string and convert them to lower case.

Or in forth:

: c>lower ( C -- c ) dup ?isupper if 32 + then ;

: c>lower$ ( c-addr u -- c-addr2 u2 f )
dup 0< if false else
over dup c@ c>lower swap c! 1- swap 1+ swap true then ;

: s>lower$ ( c-addr u -- )
begin c>lower$ 0= until 2drop ;

Congratulations All - Leaderboard

https://programming.dev/post/43295916

@kimvanwyk I have been having so much fun with Advent Of Code 2025 (https://adventofcode.com/2025) -- thanks for putting me on to that!

I'm done with Day 10 (so 20 puzzles). I was able to solve 18 completely on my own. I only used AI for lookup-type questions, e.g. easiest way to create a list comprehension that takes stringA and turns it into a list of sets. (silly made up example, just to illustrate what I used AI for -- i.e. no help with the design of the solution itself, only language specific help, not puzzle logic help.)

Day 7 Part 2: After a couple of days of frustration, I had to peek at your solution in GitHub, and immediately grok-ed the approach you took and was able to manually replicate it.

Day 10 Part 2…. I hate to report… is the first one I eventually had to turn to ChatGPT to for the entire solution. It required higher order math-combination logic that I am not at all familiar with. I first wrote logic that was able to correctly brute force the example data, but the real data took the number of combinations to ridiculous levels -- well beyond my PC's reasonable abilities. So it required algorithms that I know NOTHING about. I am VERY impressed that ChatGPT was able to first give a brute force method when I gave it the example data, and when I gave it one line from the real data, it went “woah there buddy, that’s not possible with brute force, so let me give you a mathematical algorithmic way” and it then gave me a solution which worked first try, and solves the full problem in 2.5 seconds. Hate that I had to turn to AI, but there was no way I was going to solve that.

#advent_of_code #advent_of_code_2025 #adventofcode #adventofcode2025

Advent of Code 2025

Я участвовал в Advent of Code каждый год, начиная с 2021, и мне есть что сказать

Хабр, привет! Меня зовут Стас Федянин, я ведущий инженер-программист в Контуре. Недавно завершился Advent of Code 2025 — в этом году он длился 12 дней вместо 25. Я участвовал, как и пять предыдущих лет. Созрел на эту статью, потому что подумал, что мой опыт и мнение будут интересны сообществу, ведь есть изюминка: каждый год я писал код на новом языке. Считаю, это отличный способ расширить кругозор. В статье делюсь нюансами всех опробованных языков.

https://habr.com/ru/companies/skbkontur/articles/980476/

#advent_of_code #advent_of_code_2025 #программирование #задачи #языки_программирования #gleam #javascript #kotlin #dart #zig

Я участвовал в Advent of Code каждый год, начиная с 2021, и мне есть что сказать

Меня зовут Стас Федянин, я ведущий инженер-программист в Контуре. Решаю задачки в формате AoC с 2021, и стараюсь каждый год писать на новом для себя языке программирования — уже попробовал Kotlin,...

Хабр

Back in November, I decided I was going to attempt this year's Advent of Code in uiua as far as I could.
Uiua is a tacit (no variable bindings - state is on the stack) array-programming language, strongly influenced by APL and BQN - some things were obviously going to be pretty easy in it, but I was concerned about managing larger programs in a tacit paradigm. However, given I've not done much array programming, I thought the challenge would be good for me.

Unexpected complication: I had flu - badly enough that I did have a fever and was clearly not entirely there for the second week of AoC. This meant that several of the later days had a lot of debugging needed...

My worries finally happened in Day 9 Part 2. Trying to write a relatively complex algorithm in uiua - with flu - meant that I lost track of the state of the stack somewhere. I tried debugging the code a few times [I even tried throwing LLMs at it as a last resort¹... which confidently told me multiple things that weren't true about the problem space and the code... and never found any issues - so much for the future of coding] but uiua's debugging functionality seems to rely on you using VSCode [sigh].

In the end, I solved everything but Day 9 Pt 2 and Day 10 pt 2 in uiua - it excelled at a lot of the problems (Day 11 Pt 2 was fun, although I wish uiua had built in matrix maths).
The last 2 days I finally wandered back to the unsolved parts and solved Day 9 and 10 pts2 in Julia - my solution to Day 9 was exactly the approach I tried to implement in uiua, but the Julia implementation worked perfectly first time (thanks, local variable bindings!).

So, I think it was worth it - using uiua for most of AoC did make me think a bit different for some of them - but I remain somewhat unconvinced that tacitness is a great match for more complex algorithms. (And it's worth noting that uiua's basket of operators includes several that were implemented *because* the community found it hard to solve AoC problems in stock uiua without them!)

The most fun was using the fft operator (yes, uiua has one) to solve Day 4 (both parts) in a way I don't think Eric expected - it wasn't *optimal*, but it was *fun*.

(footnote about LLMs in reply)

#advent_of_code #uiua #julia

#Advent_of_code is about close reading and not making assumptions as much as it is about solving a puzzle.

While I'm not happy with my #Forth code, I finally started on 2025 day 1 part 1. Of course I made an assumption about the live data that was wrong.

It reminds me of a one of the puzzles in Skiena's _Programming Challenges_, The 3n+1 problem (Collatz Conjecture). I was so distracted by performance issues that I failed to account for integer
overflow. Back in my 32-bit days I would have spotted that gotcha immediately.

Stack management obscures the algorithm because I haven't learned the common phrases or patterns that I need to write and understand.

As one example, here's how I increment a counter by 1:

VARIABLE var
0 var !
\ code
var dup @ 1+ swap !

It will all come clear with time.