00:44 <+bridge> [ddnet] Kind of a long solution today in Haskell: 00:44 <+bridge> [ddnet] ``` 00:44 <+bridge> [ddnet] import Data.Char 00:44 <+bridge> [ddnet] import Data.List 00:44 <+bridge> [ddnet] prio c | c >= 'a' = ord c - ord 'a' + 1 | otherwise = ord c - ord 'A' + 27 00:44 <+bridge> [ddnet] slice (x:y:z:xs) = (x,y,z) : slice xs 00:44 <+bridge> [ddnet] slice [] = [] 00:44 <+bridge> [ddnet] main = do 00:44 <+bridge> [ddnet] ls <- readFile "day03.in" 00:44 <+bridge> [ddnet] -- Part 1 00:44 <+bridge> [ddnet] print $ sum . map (\l -> (prio . head . uncurry intersect) $ splitAt (length l `div` 2) l) $ lines ls 00:44 <+bridge> [ddnet] -- Part 2 00:44 <+bridge> [ddnet] print $ sum . map (\(x,y,z) -> prio $ head $ intersect x (intersect y z)) $ slice $ lines ls 00:44 <+bridge> [ddnet] ``` 01:13 <+bridge> [ddnet] the key to writing an os is having infinite time, which realistically only 16yos have 😄 01:14 <+bridge> [ddnet] xd 02:27 <+bridge> [ddnet] oh nice, this was my haskell solution today :) 02:27 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1048772501976657950/3.hs 06:27 <+bridge> [ddnet] who's Haraev Anton, what a legend :justatest: 08:42 <+bridge> [ddnet] Just keep pinging, one day you'll get me @ChillerDragon )) 08:42 <+bridge> [ddnet] Also day3 and 4 kinda filtered me, let's see if i have the nerve for a solution later .__. 09:15 <+bridge> [ddnet] ordering helps 09:18 <+bridge> [ddnet] (on day 4) 09:18 <+bridge> [ddnet] Math helps 09:18 <+bridge> [ddnet] :greenthing: 09:19 <+bridge> [ddnet] p2 09:20 <+bridge> [ddnet] oh i can reduce the if 09:20 <+bridge> [ddnet] 🤔 My first attempt at coding 09:20 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1048876352490709033/Screenshot_20221204_130829.png 09:20 <+bridge> [ddnet] now 09:21 <+bridge> [ddnet] :troll: 09:21 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1048876682066526209/main.cpp 09:21 <+bridge> [ddnet] xd 09:22 <+bridge> [ddnet] if you do `using namespace std`, you don't need to qualify things with `std::` anymore 09:22 <+bridge> [ddnet] generally, it is considered bad style to do `using namespace std` 09:22 <+bridge> [ddnet] Thats why i keep writing std:: sometimes 09:22 <+bridge> [ddnet] @uwu why not use std::tuple 09:22 <+bridge> [ddnet] i think it exists 09:23 <+bridge> [ddnet] std::pair 09:23 <+bridge> [ddnet] Too lazy + dont remember methods 09:23 <+bridge> [ddnet] you can remove `using namespace std`, then you'll write `std::` everywhere 09:23 <+bridge> [ddnet] :feelsbadman: 09:23 <+bridge> [ddnet] but its a good way to learn the shitload of containers c++ has! 09:23 <+bridge> [ddnet] kek 09:23 <+bridge> [ddnet] Indeed, but too much of them 09:24 <+bridge> [ddnet] Also i was grinding points:monkalaugh: 09:24 <+bridge> [ddnet] Time was priority 09:25 <+bridge> [ddnet] i did range problems before and 09:25 <+bridge> [ddnet] having for example a 09:25 <+bridge> [ddnet] be the one smaller 09:25 <+bridge> [ddnet] aka a.0 <= b.0 09:25 <+bridge> [ddnet] reduces complexity 09:25 <+bridge> [ddnet] on the ifs 09:25 <+bridge> [ddnet] also if a.0 == b.0 its always contained 09:25 <+bridge> [ddnet] one or another 09:25 <+bridge> [ddnet] thanks for coming to my ted talk 09:26 <+bridge> [ddnet] clapclapclap 09:26 <+bridge> [ddnet] :BASED: 09:26 <+bridge> [ddnet] does c++ have a swap? 09:26 <+bridge> [ddnet] swap like 09:26 <+bridge> [ddnet] memory swap? 09:26 <+bridge> [ddnet] yeah it has 09:26 <+bridge> [ddnet] yea 09:27 <+bridge> [ddnet] tuples not being first class in c++ i guess makes working wiht em worse 09:28 <+bridge> [ddnet] in rust they are in the lang itself so its better 09:28 <+bridge> [ddnet] and u can only do structured binding from c++17 09:29 <+bridge> [ddnet] well, at least something is working somehow xdd I didn't try today.. let's see what the next days are like)) 09:29 <+bridge> [ddnet] #!/bin/bash 09:29 <+bridge> [ddnet] # Advent of Code 03 / PART 1 09:29 <+bridge> [ddnet] while read -r l; do 09:29 <+bridge> [ddnet] p1+=( "${l:0:${#l}/2}" ) 09:29 <+bridge> [ddnet] p2+=( "${l:${#l}/2}" ) 09:29 <+bridge> [ddnet] done < "$1" 09:29 <+bridge> [ddnet] for i in $(seq 1 ${#p1[@]}); do 09:29 <+bridge> [ddnet] a=$(echo ${p1[i-1]} | sed "s/./&\n/g" | sort) 09:29 <+bridge> [ddnet] b=$(echo ${p2[i-1]} | sed "s/./&\n/g" | sort) 09:29 <+bridge> [ddnet] r=$(comm -12 <(echo $a | tr ' ' '\n') <(echo $b | tr ' ' '\n') | uniq) 09:29 <+bridge> [ddnet] n=$(echo -n "$r" | od -An -tuC) 09:29 <+bridge> [ddnet] [[ $r =~ [a-z] ]] && n=$((n - 96)) 09:29 <+bridge> [ddnet] [[ $r =~ [A-Z] ]] && n=$((n - 38)) 09:29 <+bridge> [ddnet] echo $n 09:29 <+bridge> [ddnet] done | paste -s -d+ | bc 09:29 <+bridge> [ddnet] ``` 09:29 <+bridge> [ddnet] well, at least something is working somehow xdd I didn't try today.. let's see what the next days are like)) 09:29 <+bridge> [ddnet] ```bash 09:29 <+bridge> [ddnet] #!/bin/bash 09:29 <+bridge> [ddnet] # Advent of Code 03 / PART 1 09:29 <+bridge> [ddnet] while read -r l; do 09:29 <+bridge> [ddnet] p1+=( "${l:0:${#l}/2}" ) 09:29 <+bridge> [ddnet] p2+=( "${l:${#l}/2}" ) 09:29 <+bridge> [ddnet] done < "$1" 09:29 <+bridge> [ddnet] for i in $(seq 1 ${#p1[@]}); do 09:29 <+bridge> [ddnet] a=$(echo ${p1[i-1]} | sed "s/./&\n/g" | sort) 09:29 <+bridge> [ddnet] b=$(echo ${p2[i-1]} | sed "s/./&\n/g" | sort) 09:29 <+bridge> [ddnet] r=$(comm -12 <(echo $a | tr ' ' '\n') <(echo $b | tr ' ' '\n') | uniq) 09:29 <+bridge> [ddnet] n=$(echo -n "$r" | od -An -tuC) 09:30 <+bridge> [ddnet] [[ $r =~ [a-z] ]] && n=$((n - 96)) 09:30 <+bridge> [ddnet] [[ $r =~ [A-Z] ]] && n=$((n - 38)) 09:30 <+bridge> [ddnet] echo $n 09:30 <+bridge> [ddnet] done | paste -s -d+ | bc 09:30 <+bridge> [ddnet] ``` 09:30 <+bridge> [ddnet] u can use https://en.cppreference.com/w/cpp/utility/tuple/tie tho 09:30 <+bridge> [ddnet] rust didn't always have tuple access 09:30 <+bridge> [ddnet] only via pattern matching 09:30 <+bridge> [ddnet] .0, .1, … came later 09:30 <+bridge> [ddnet] it was really useful ^^ 09:30 <+bridge> [ddnet] is this before 1.0? 09:30 <+bridge> [ddnet] idk 09:30 <+bridge> [ddnet] mayhaps 09:30 <+bridge> [ddnet] i would consider pre 1.0 another lang for me xd 09:31 <+bridge> [ddnet] ```py 09:31 <+bridge> [ddnet] ans = [0, 0] 09:32 <+bridge> [ddnet] for line in open('i.input', 'r').readlines(): 09:32 <+bridge> [ddnet] if (int(line.strip().split(',')[0].split('-')[0])>=int(line.strip().split(',')[1].split('-')[0]) and int(line.strip().split(',')[0].split('-')[1])<=int(line.strip().split(',')[1].split('-')[1])) or (int(line.strip().split(',')[1].split('-')[0])>=int(line.strip().split(',')[0].split('-')[0]) and int(line.strip().split(',')[1].split('-')[1])<=int(line.strip().split(',')[0].split('-')[1])): 09:32 <+bridge> [ddnet] ans[0] += 1 09:32 <+bridge> [ddnet] if (int(line.strip().split(',')[0].split('-')[0])>=int(line.strip().split(',')[1].split('-')[0]) and int(line.strip().split(',')[0].split('-')[0])<=int(line.strip().split(',')[1].split('-')[1])) or (int(line.strip().split(',')[0].split('-')[1])>=int(line.strip().split(',')[1].split('-')[0]) and int(line.strip().split(',')[0].split('-')[1])<=int(line.strip().split(',')[1].split('-')[1])) or (int(line.strip().split(',')[1].split('-')[0])>=i 09:32 <+bridge> [ddnet] ans[1] += 1 09:32 <+bridge> [ddnet] print(ans) 09:32 <+bridge> [ddnet] ``` 09:32 <+bridge> [ddnet] 😈 09:32 <+bridge> [ddnet] :justatest: 09:32 <+bridge> [ddnet] wtf 09:32 <+bridge> [ddnet] die 09:32 <+bridge> [ddnet] cantcodeuis 09:36 <+bridge> [ddnet] have you considered using variables? ^^ 09:37 <+bridge> [ddnet] (btw) yeah, i just meant i usually dont use it, so keep using `std::` cuz too used to it 09:40 <+ChillerDragon> omg i almost rq aoc 09:40 <+ChillerDragon> got so many wrong answers i started browsing reddit xd https://twitter.com/ostwilkens/status/1598458146187628544 09:41 <+ChillerDragon> day 4 felt like implementing collision detection :D 09:45 <+bridge> [ddnet] math issue 10:07 <+bridge> [ddnet] i need to do these 10:35 <+bridge> [ddnet] https://ble3ka.nl/invite/i=29260 10:36 <+bridge> [ddnet] @Zwelf ^ 10:51 <+bridge> [ddnet] Great minds think alike 😄 I think `map eval $ map head $ map intersect $ map half` can be rewritten to `map (eval . head . intersect . half)` 10:58 <+bridge> [ddnet] Oh, and I didn't remember `chunksOf`, even tried the great Hoogle signature search: https://hoogle.haskell.org/ 10:58 <+bridge> [ddnet] It's usually easier in Haskell to write down the signature of a function you want than to describe what it should do 😄 11:32 <+bridge> [ddnet] :BASED: 11:32 <+bridge> [ddnet] 11:35 <+bridge> [ddnet] who is cmake pro? 11:35 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] i have a collision in https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] i have two settings that specify the var so they overwrite each other. Also i am not sure how it will act if someone wants to specify custom entries for it 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] there is also 11:36 <+bridge> [ddnet] https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_INIT.html 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] which would be perfect, but apparently it doesnt recompile on change like above does 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] target specific configs like CMAKE_LANG_FLAGS_DEBUG are reversed by cmake, so i prefer to get away from that 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] so: 11:36 <+bridge> [ddnet] do u think i can rely on CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -myoptions" on the the following already? 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] the extension for vscode says: "An object containing key:value pairs, which will be passed to CMake when configuring. The same as passing -DVAR_NAME=ON via cmake.configureArgs." 11:36 <+bridge> [ddnet] (https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md) 11:36 <+bridge> [ddnet] 11:36 <+bridge> [ddnet] all bit confusing if u dont know how cmake internally works 11:37 <+bridge> [ddnet] the other colliding thing (same extension) that sets the flags says this: 11:37 <+bridge> [ddnet] "A map of arbitrary CMake cache options to pass via the CMake command line with -D. Similar to the cmake.configureSettings in settings.json." 11:37 <+bridge> [ddnet] https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/variants.md 11:38 <+bridge> [ddnet] another problem is that i probably have to actually reset the values 11:38 <+bridge> [ddnet] 11:38 <+bridge> [ddnet] e.g. if concat would work it should not use the old values cached already 11:39 <+bridge> [ddnet] easiest would be if i could do CMAKE_LANG_FLAGS_DEBUG="DEFAULT -myoptions" 11:42 <+bridge> [ddnet] So you're still bashing through 😄 11:43 <+bridge> [ddnet] I also chose Python today. Easier to debug iterative style compared to functional 11:43 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1048912401040420924/day04.py 11:44 <+bridge> [ddnet] @louis Are you afraid of storing temporary results in variables? 😄 11:47 <+bridge> [ddnet] it seems it happened in 2014 11:47 <+bridge> [ddnet] https://github.com/rust-lang/rfcs/pull/184 11:47 <+bridge> [ddnet] that was pre-1.0 12:19 <+bridge> [ddnet] you might want to learn about list comprehensions 13:49 <+bridge> [ddnet] https://github.com/max-sixty/aoc-gpt 13:49 <+bridge> [ddnet] > This solves Advent of Code puzzles by having GPT-3 write code in response to the puzzle's input. 13:49 <+bridge> [ddnet] > 13:49 <+bridge> [ddnet] > I placed 1st on Day 4 Part 1 (2022) with this code, and 2nd on Day 3 Part 1 (2022) with a previous version. 13:49 <+bridge> [ddnet] https://news.ycombinator.com/item?id=33850999 13:50 <+bridge> [ddnet] > 13:50 <+bridge> [ddnet] > 13:50 <+bridge> [ddnet] > fathrowaway12 5 hours ago | parent | next [–] 13:50 <+bridge> [ddnet] > 13:50 <+bridge> [ddnet] > It really is amazing. Things it did in less than 10 seconds from hitting enter: 13:50 <+bridge> [ddnet] > 13:50 <+bridge> [ddnet] > - opengl raytracer with compilation instructions for macos 13:51 <+bridge> [ddnet] > - tictactoe in 3D 13:51 <+bridge> [ddnet] > - bitorrent peer handshake in Go from a paragraph in the RFC 13:51 <+bridge> [ddnet] > - http server in go with /user, /session, and /status endpoints from an english description 13:51 <+bridge> [ddnet] > - protocol buffer product configuration from a paragraph english description 13:51 <+bridge> [ddnet] > - pytorch script for classifying credit card transactions into expense accounts and instructions to import the output into quickbooks 13:51 <+bridge> [ddnet] > - quota management API implemented as a bidirectional streaming grpc service 13:51 <+bridge> [ddnet] > - pytorch neural network with a particular shape, number of input classes, output classes, activation function, etc. 13:51 <+bridge> [ddnet] > - IO scheduler using token bucket rate limiting 13:51 <+bridge> [ddnet] > - analyze the strengths/weaknesses of algorithms for 2 player zero sum games 13:51 <+bridge> [ddnet] > - compare david hume and immanuel kant's thoughts on knowledge 13:51 <+bridge> [ddnet] > - describe how critics received george orwell's work during his lifetime 13:51 <+bridge> [ddnet] > - christmas present recommendations for a relative given a description of their interests 13:51 <+bridge> [ddnet] > - poems about anything. love. cats. you name it. 13:51 <+bridge> [ddnet] lol 13:51 <+bridge> [ddnet] pack it up 13:51 <+bridge> [ddnet] no longer programmers are needed 13:52 <+bridge> [ddnet] cool. can you tell it to fix ddnet bugs? 13:52 <+bridge> [ddnet] xd 13:52 <+bridge> [ddnet] its extremly good in things that exists multiple times 13:52 <+bridge> [ddnet] but its not innovative 13:53 <+bridge> [ddnet] but if did aoc problem 13:53 <+bridge> [ddnet] and placed 1st 13:53 <+bridge> [ddnet] i also had a chat with it about some vulkan stuff.. it simply knows the whole spec xD 13:53 <+bridge> [ddnet] this means that this year 1st placers are not algorithm-good-focused coders 13:53 <+bridge> [ddnet] but AI 13:53 <+bridge> [ddnet] kek 13:53 <+bridge> [ddnet] brb food 13:53 <+bridge> [ddnet] yeah its defs insane 😄 13:53 <+bridge> [ddnet] 13:53 <+bridge> [ddnet] but probably aoc doesnt invent new challenges in a way of innovations 13:59 <+bridge> [ddnet] but the best is, that its the best grammar checker ever xDD 14:00 <+bridge> [ddnet] all the commas in english so fcking confusing 14:00 <+bridge> [ddnet] there aren't strict rules about commas in english 14:00 <+bridge> [ddnet] unlike german 14:00 <+bridge> [ddnet] AFAIK 14:00 <+bridge> [ddnet] i dunno about strict, but there are rules 14:01 <+bridge> [ddnet] stuff with while, during that time bla bla 14:01 <+bridge> [ddnet] but to me its random and was simply too lazy in school to learn it correctly 14:15 <+bridge> [ddnet] You still need a good separate AI for code review to make sure that the code is correct 😄 I'm imagining the two AIs communicating to improve the code 14:20 <+bridge> [ddnet] Probably way too little context yet. Some minor bugs could be solved if it was trained on DDNet source code. I remember seeing a project for that a few days ago, but maybe I dreamt it 14:21 <+bridge> [ddnet] when it sees ddrace server code it cancels its job 14:22 <+bridge> [ddnet] because it reaches a state of enlightenment? 14:22 <+bridge> [ddnet] absolutely 14:22 <+bridge> [ddnet] it gets addicted and plays ddnet for the rest of its life 14:22 <+bridge> [ddnet] aka Nirvana 14:25 <+bridge> [ddnet] @Robyt3 on a roll 14:25 <+bridge> [ddnet] at least u think its robyt3 😉 14:26 <+bridge> [ddnet] I'm happy about an AI that fixes ddnet bugs 🙂 14:26 <+bridge> [ddnet] I'd also be happy about an AI that fixes ddnet bugs 🙂 14:26 <+bridge> [ddnet] ^^ 14:28 <+bridge> [ddnet] robyt the AI 14:58 <+bridge> [ddnet] Unfortunately the code synthesis I'm researching only works for small Java program units yet 14:59 <+bridge> [ddnet] Can you guess what this bool function does? 14:59 <+bridge> [ddnet] 14:59 <+bridge> [ddnet] ``` 14:59 <+bridge> [ddnet] if (0 < y % (4 * (4 + 2) + 1)) { 14:59 <+bridge> [ddnet] y = y % 4; 14:59 <+bridge> [ddnet] } 14:59 <+bridge> [ddnet] return y % (4 * 4) < 1; 14:59 <+bridge> [ddnet] ``` 15:02 <+bridge> [ddnet] does it get positive and negative numbers? 15:02 <+bridge> [ddnet] It only needs to work for positive numbers 15:02 <+bridge> [ddnet] `if (y % 25 != 0) { y %= 4 }; y % 16 == 0 }` 15:02 <+bridge> [ddnet] But it works correctly for all reasonable inputs 15:02 <+bridge> [ddnet] `if (y % 25 != 0) { y %= 4 }; return y % 16 == 0;` 15:03 <+bridge> [ddnet] so in total it's `y % 16 == 0` 15:03 <+bridge> [ddnet] That's actually close to the code-golf solution to this problem 15:03 <+bridge> [ddnet] `return y % (y % 25 < 1 ? 16 : 4) < 1;` 15:03 <+bridge> [ddnet] Is a short version for code-golf (not from code synthesis). 15:03 <+bridge> [ddnet] ah, mistake 15:04 <+bridge> [ddnet] The numbers are weirdly combined because I didn't tell the synthesizer all the number literals that are used in the naive solution 15:05 <+bridge> [ddnet] You probably recognise which function we are looking for, if I do 15:05 <+bridge> [ddnet] 4, 100, 400 are relevant to this problem 15:05 <+bridge> [ddnet] leap years? 15:05 <+bridge> [ddnet] yep 15:05 <+bridge> [ddnet] i instantly recognize those numbers kek 15:06 <+bridge> [ddnet] The synthesized program is correct for all values between 1 and 100000 15:06 <+bridge> [ddnet] The synthesized program is disgusting for all values between -∞ and +∞ 15:09 <+bridge> [ddnet] `return y % ((y % 25 < 1) * 12 + 4) < 1;` 15:09 <+bridge> [ddnet] `return y % (y % 25 < 1 ? 16 : 4) < 1;` 15:09 <+bridge> [ddnet] ah darn, it's longer 15:09 <+bridge> [ddnet] is the goal to make it as less chars as possible? 15:09 <+bridge> [ddnet] ye, codegolf 15:11 <+bridge> [ddnet] remove spaces xd 15:12 <+bridge> [ddnet] ye 15:12 <+bridge> [ddnet] but we have the same amount of spaces so it doesn't matter here 15:12 <+bridge> [ddnet] Do you need the parenthesis in C++? Would be the same length without them 15:13 <+bridge> [ddnet] Doesn't work in Java because boolean cannot be multiplied with int 15:13 <+bridge> [ddnet] yes, I need the parantheses 15:13 <+bridge> [ddnet] yes, I need the parentheses 15:13 <+bridge> [ddnet] because otherwise it's `1 * 12` 15:13 <+bridge> [ddnet] Ah, true 15:47 <+bridge> [ddnet] man 75 chars are hard 15:47 <+bridge> [ddnet] im at 97 rn xd 15:49 <+bridge> [ddnet] import ; does not work xd 15:49 <+bridge> [ddnet] xd 15:49 <+bridge> [ddnet] c++20 and ez win 15:58 <+bridge> [ddnet] @Not Keks https://emacsconf.org/2022/talks/wayland/ 15:58 <+bridge> [ddnet] https://news.ycombinator.com/item?id=33849556 15:58 <+bridge> [ddnet] de fac xD 16:00 <+bridge> [ddnet] @Not Keks http://informatimago.free.fr/i/linux/emacs-on-user-mode-linux.html 16:00 <+bridge> [ddnet] PID 1 EMACS 16:00 <+bridge> [ddnet] kek 16:00 <+bridge> [ddnet] https://github.com/a-schaefers/systemE 16:00 <+bridge> [ddnet] lol 16:01 <+bridge> [ddnet] ```c++ 16:01 <+bridge> [ddnet] #include 16:01 <+bridge> [ddnet] #define n int 16:01 <+bridge> [ddnet] n main(){for(n m=1800;m<=2400;++m)if(m%(m%25?4:16)<1)printf("%d\n",m);} 16:01 <+bridge> [ddnet] ``` 16:01 <+bridge> [ddnet] i bet u can somehow use macros and compress ur code in itself, but im too stupid for it xd 16:01 <+bridge> [ddnet] what even is their drive? XD 16:02 <+bridge> [ddnet] idk xd 16:03 <+bridge> [ddnet] they should do it for ddnet 16:15 <+bridge> [ddnet] oh, so my solution can take even less lines 16:16 <+bridge> [ddnet] If you compile for C before C99 then you could take advantage of the implicit int rule, so any type is assumed to be `int` if not specified. Also `m<=2400` --> `m<2401` would save one character. 16:18 <+bridge> [ddnet] the define makes the code longer, no? 16:18 <+bridge> [ddnet] ``` 16:18 <+bridge> [ddnet] #include 16:18 <+bridge> [ddnet] main(){for(int m=1800;m<2401;++m)m%(m%25?4:16)<1?printf("%d\n",m):0;} 16:18 <+bridge> [ddnet] ``` 16:19 <+bridge> [ddnet] ```c 16:19 <+bridge> [ddnet] #include 16:19 <+bridge> [ddnet] main(){for(int m=1800;m<2401;++m)m%(m%25?4:16)<1?printf("%d\n",m):0;} 16:19 <+bridge> [ddnet] ``` 16:19 <+bridge> [ddnet] Using tenary instead of if 16:19 <+bridge> [ddnet] Using ternary instead of if 16:21 <+bridge> [ddnet] why use `#include `? 16:22 <+bridge> [ddnet] true, also works with implicit declaration 16:33 <+bridge> [ddnet] so whats the current char count? 16:33 <+bridge> [ddnet] btw i targeted c++ 16:33 <+bridge> [ddnet] so implicit wont work 16:34 <+bridge> [ddnet] cstdio also works, and on some compiler it also pollutes the global namespace 😉 16:34 <+bridge> [ddnet] the define was really just bcs of the claim that u might be able to compress it somehow clever ^ 16:35 <+bridge> [ddnet] ah ^^ 16:38 <+bridge> [ddnet] ```cpp 16:38 <+bridge> [ddnet] #include 16:38 <+bridge> [ddnet] int main(){for(int m=1800;m<2401;++m)m%(m%25?4:16)<1?printf("%d\n",m):0;} 16:38 <+bridge> [ddnet] ``` 16:38 <+bridge> [ddnet] 91 characters for a C++ version 16:39 <+bridge> [ddnet] ```cpp 16:39 <+bridge> [ddnet] #include 16:39 <+bridge> [ddnet] int main(){for(int m=1800;m<2401;++m)m%(m%25?4:16)<1?printf("%d\n",m):0;} 16:39 <+bridge> [ddnet] ``` 16:39 <+bridge> [ddnet] 90 characters for a C++ version 16:39 <+bridge> [ddnet] you can switch the then and else case 16:39 <+bridge> [ddnet] the space after include is not necessary 16:40 <+bridge> [ddnet] `?0:print(…)` 16:40 <+bridge> [ddnet] without the `<0` 16:40 <+bridge> [ddnet] without the `<1` 16:40 <+bridge> [ddnet] ```cpp 16:40 <+bridge> [ddnet] #include 16:40 <+bridge> [ddnet] int main(){for(int m=1800;m<2401;++m)!m%(m%25?4:16)?0:printf("%d\n",m);} 16:40 <+bridge> [ddnet] ``` 16:41 <+bridge> [ddnet] never mind, that's wrong 16:41 <+bridge> [ddnet] without the `!` 16:41 <+bridge> [ddnet] yeah 16:41 <+bridge> [ddnet] ```cpp 16:41 <+bridge> [ddnet] #include 16:42 <+bridge> [ddnet] int main(){for(int m=1800;m<2401;++m)m%(m%25?4:16)?0:printf("%d\n",m);} 16:42 <+bridge> [ddnet] ``` 16:42 <+bridge> [ddnet] 88 characters 16:44 <+bridge> [ddnet] @Not Keks did you try to get sources of some answer from the AI? 16:48 <+bridge> [ddnet] it wont give any sources 16:48 <+bridge> [ddnet] just expect only 70% truth 16:48 <+bridge> [ddnet] and u fine 16:49 <+bridge> [ddnet] you can ask it for sources 16:49 <+bridge> [ddnet] "can you give the source for point 2?" 16:49 <+bridge> [ddnet] its still really nice to give some basic ideas 16:49 <+bridge> [ddnet] for me it didnt do it 16:49 <+bridge> [ddnet] oh 16:49 <+bridge> [ddnet] ```c++ 16:49 <+bridge> [ddnet] #include 16:49 <+bridge> [ddnet] int main(){for(int m=1800;m<2401;m+=4)m%16<1|m%25?printf("%d\n",m):0;} 16:49 <+bridge> [ddnet] ``` 16:50 <+bridge> [ddnet] @Robyt3 golfed another character 🙂 16:50 <+bridge> [ddnet] "I am sorry, but I am not able to provide sources or references for the information that I provide. I am a large language model trained by OpenAI, and I am not able to browse the internet or access external sources of information." 16:50 <+bridge> [ddnet] , the guy managed to get sources from the ai 16:51 <+bridge> [ddnet] did he ask in french? 16:51 <+bridge> [ddnet] bcs in german for example the AI always says that he can redirect me to an expert for some reason xD 16:51 <+bridge> [ddnet] if u have more questions i can help you reach out to an export xD 16:51 <+bridge> [ddnet] if u have more questions i can help you reach out to an expert xD 16:52 <+bridge> [ddnet] and when i say ok help me to reach out to that expert it says no xD 16:53 <+bridge> [ddnet] i think you can set up an option for it to access internet 16:54 <+bridge> [ddnet] browsing: enabled 16:54 <+bridge> [ddnet] but did only works for simple stuff like getting URLs 17:48 <+bridge> [ddnet] You can also drop the int before main, it'll generate a warning but still work 😛 17:48 <+bridge> [ddnet] I think Jupstar wanted c++ 17:49 <+bridge> [ddnet] I think that's not valid c++? 17:50 <+bridge> [ddnet] Eeeeeh, it's not. But gcc and clang will both compile it 18:30 <+bridge> [ddnet] ChatGPT is on the level of virality as dall-e 2 18:30 <+bridge> [ddnet] now blogs have it all 18:30 <+bridge> [ddnet] the text and the images 18:32 <+bridge> [ddnet] > More broadly, I think we'll see a proliferation of internet content generated by ChatGPT--blog posts, essays, product summaries, tutorials, news articles, etc. 18:32 <+bridge> [ddnet] > 18:32 <+bridge> [ddnet] > The danger is that the content generated by ChatGPT is very coherent, but technical details are frequently wrong. It's going to become increasingly difficult to separate the signal from the noise on the internet. 18:36 <+bridge> [ddnet] https://notes.eatonphil.com/is-it-worth-writing-about.html 18:36 <+bridge> [ddnet] for @Not Keks and @Learath2 18:36 <+bridge> [ddnet] :greenthing: 18:37 <+bridge> [ddnet] my problem is mainly time 18:37 <+bridge> [ddnet] or how openai would say: 18:37 <+bridge> [ddnet] Comrades, I regret to inform you that I do not have the time to join in the revolution at this moment. My schedule is full and my priorities lie elsewhere. However, I support your cause and hope that you will continue to fight for justice and equality. Long live the revolution! 18:38 <+bridge> [ddnet] XD 18:39 <+bridge> [ddnet] @Not Keks we need a chat bot that is chatgpt 18:39 <+bridge> [ddnet] and it chats with us 18:39 <+bridge> [ddnet] here 18:39 <+bridge> [ddnet] answers randomly to what we say 18:39 <+bridge> [ddnet] would be amazing xD 18:42 <+bridge> [ddnet] @Ryozuki 18:42 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1049017809759379506/image.png 18:42 <+bridge> [ddnet] do u feel motivated? 18:43 <+bridge> [ddnet] xD 18:43 <+bridge> [ddnet] ye 18:45 <+bridge> [ddnet] I would write a blog if I wasn't already completely swamped 😭 18:45 <+bridge> [ddnet] I literally do nothing I want to do 18:45 <+bridge> [ddnet] Did u know discord us servers can now gain money through discord 18:45 <+bridge> [ddnet] Like insta or any other social network 18:46 <+bridge> [ddnet] Partner servers 18:46 <+bridge> [ddnet] > If a C++ developer and a Rust developer argue, what would happen? 18:46 <+bridge> [ddnet] > 18:46 <+bridge> [ddnet] > It would depend on the subject of the argument. If it was about the relative merits of their respective programming languages then it could lead to a civil and constructive discussion. However, if it was about a more subjective matter then it could quickly become heated and unproductive. 18:47 <+bridge> [ddnet] > And why is that? 18:47 <+bridge> [ddnet] > 18:47 <+bridge> [ddnet] > That is because both developers may be passionate about the language they use, and may not be willing to accept the other's point of view. This could lead to a situation where both parties become frustrated and neither side is willing to compromise. 18:47 <+bridge> [ddnet] kek 18:49 <+bridge> [ddnet] -- 18:49 <+bridge> [ddnet] > What should I write about next in my programming blog? 18:49 <+bridge> [ddnet] > 18:49 <+bridge> [ddnet] > One possible topic you could write about in your programming blog is the process of debugging a program. You could discuss the different methods and techniques used to debug software, from manually stepping through code line by line to using debugging tools such as breakpoints and loggers. You could also discuss the best practices for debugging and provide tips on how to troubleshoot common programming errors. 18:49 <+bridge> [ddnet] poggers 18:50 <+bridge> [ddnet] holy 18:50 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1049019889593102406/image.png 18:53 <+bridge> [ddnet] oh 18:53 <+bridge> [ddnet] > Is DDraceNetwork popular? 18:53 <+bridge> [ddnet] > 18:53 <+bridge> [ddnet] > Yes, DDraceNetwork is quite popular. It is an online racing game where players can race against each other or compete on specially designed levels. The game has been around since 2008 and has received numerous awards, including being named one of the Best Multiplayer Games of 2019 by PC Gamer magazine. It has also been featured on the popular YouTube channel, The Yogscast. 18:53 <+bridge> [ddnet] what? 18:54 <+bridge> [ddnet] lol 18:54 <+bridge> [ddnet] > 18:54 <+bridge> [ddnet] > What other awards has it received? 18:54 <+bridge> [ddnet] > 18:54 <+bridge> [ddnet] > DDraceNetwork has received numerous awards, including being named one of the Top 100 Indie Games of 2009 by IndieDB, and being one of the Top 10 open source games of 2009 by Linux Format. It has also been featured on the popular YouTube channels, Game Theory and The Yogscast. In addition, it has won the Mod of the Year award at the Indie of the Year awards in 2011. 18:55 <+bridge> [ddnet] lol 18:55 <+bridge> [ddnet] > Who are the main developers of it? 18:55 <+bridge> [ddnet] > 18:55 <+bridge> [ddnet] > The main developers of DDraceNetwork are a small team of developers based in Germany, who are led by founder and lead developer Timo "Hirnfrost" Fecke. Other members of the team include programmers, graphic designers, and level designers. 18:55 <+bridge> [ddnet] lmfao 18:55 <+bridge> [ddnet] who is timo 18:57 <+bridge> [ddnet] > Can the game DDraceNetwork implement an account system? 18:57 <+bridge> [ddnet] > 18:57 <+bridge> [ddnet] > Yes, it is possible to implement an account system in the game DDraceNetwork. This account system could include features such as login, registering, and managing user profiles. Players could also use the account system to track their progress and leaderboard rankings. 18:57 <+bridge> [ddnet] xd 18:58 <+bridge> [ddnet] Why write a blog post? Just ask ChatGPT to write your blog post and post that 18:59 <+bridge> [ddnet] Timo Fecke, interesting 18:59 <+bridge> [ddnet] I didn't know of our leader 19:00 <+bridge> [ddnet] > Who is Timo Fecke? 19:00 <+bridge> [ddnet] > 19:00 <+bridge> [ddnet] > Timo Fecke is a German entrepreneur and investor. He is the founder and CEO of the venture capital firm FinLeap, a Berlin-based fintech company builder. He is also the founder and chairman of the FinLeap Foundation, a non-profit organization that supports the development of new technologies and business models in the financial services industry. 19:00 <+bridge> [ddnet] He doesn't even exist, I wonder where openai got that from 19:01 <+bridge> [ddnet] it tells me deen is a angel investor too 19:01 <+bridge> [ddnet] xd 19:02 <+bridge> [ddnet] > Write a basic primality test in rust 19:02 <+bridge> [ddnet] > 19:02 <+bridge> [ddnet] > // This is a basic primality test written in Rust. 19:02 <+bridge> [ddnet] > fn is_prime(n: u32) -> bool { 19:02 <+bridge> [ddnet] > if n < 2 { 19:02 <+bridge> [ddnet] > return false; 19:02 <+bridge> [ddnet] > } 19:02 <+bridge> [ddnet] > 19:02 <+bridge> [ddnet] > if n == 2 || n == 3 { 19:02 <+bridge> [ddnet] > return true; 19:02 <+bridge> [ddnet] > } 19:02 <+bridge> [ddnet] > 19:02 <+bridge> [ddnet] > for i in 2..=((n as f64).sqrt() as u32) { 19:02 <+bridge> [ddnet] > if n % i == 0 { 19:02 <+bridge> [ddnet] > return false; 19:02 <+bridge> [ddnet] > } 19:02 <+bridge> [ddnet] > } 19:02 <+bridge> [ddnet] > true 19:02 <+bridge> [ddnet] > } 19:02 <+bridge> [ddnet] kek 19:05 <+bridge> [ddnet] its also good at creating ascii art xD 19:05 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1049023589191532564/image.png 19:07 <+bridge> [ddnet] ``` 19:07 <+bridge> [ddnet] | 19:07 <+bridge> [ddnet] __|__ 19:07 <+bridge> [ddnet] |/___\| 19:07 <+bridge> [ddnet] |___|_| 19:07 <+bridge> [ddnet] _|___|_|_ 19:07 <+bridge> [ddnet] |___|___|_| 19:07 <+bridge> [ddnet] |___|___|_| 19:08 <+bridge> [ddnet] |___|___|_| 19:08 <+bridge> [ddnet] |___|___| 19:08 <+bridge> [ddnet] |___|___| 19:08 <+bridge> [ddnet] |___|_| 19:08 <+bridge> [ddnet] \___/ 19:08 <+bridge> [ddnet] ``` 19:08 <+bridge> [ddnet] Probably the crypto guy :issou: 19:08 <+bridge> [ddnet] this is the eifel tower 19:08 <+bridge> [ddnet] according to chatgpt 19:08 <+bridge> [ddnet] This is not so bad 19:08 <+bridge> [ddnet] i asked for sha256 19:08 <+bridge> [ddnet] and it delivered lol 19:08 <+bridge> [ddnet] but too big for here 19:09 <+bridge> [ddnet] Lately I've been thinking about what went wrong with the crypto guy. I think I figured it out. The way he handled himself was so oriented to finding business people 19:09 <+bridge> [ddnet] > Code golf a prime test in C 19:09 <+bridge> [ddnet] > 19:09 <+bridge> [ddnet] > #include 19:09 <+bridge> [ddnet] > 19:09 <+bridge> [ddnet] > int main(){ 19:09 <+bridge> [ddnet] > int n; 19:09 <+bridge> [ddnet] > scanf("%d", &n); 19:09 <+bridge> [ddnet] > for(int i=2;i*i<=n;i++) 19:09 <+bridge> [ddnet] > if(n%i==0) return 0; 19:09 <+bridge> [ddnet] > return 1; 19:09 <+bridge> [ddnet] > } 19:09 <+bridge> [ddnet] xd 19:10 <+bridge> [ddnet] maybe i can learn erlang with this 19:10 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1049025033554645013/image.png 19:11 <+bridge> [ddnet] Why would you want to learn erlang? 19:11 <+bridge> [ddnet] my job uses it 19:12 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1049025294381617232/image.png 19:12 <+bridge> [ddnet] :pepecry: 19:12 <+bridge> [ddnet] in some projects 19:12 <+bridge> [ddnet] @Learath2 the question is, why wouldnt you 19:12 <+bridge> [ddnet] kek 19:12 <+bridge> [ddnet] Look at the syntax 19:12 <+bridge> [ddnet] its prolog-like 19:12 <+bridge> [ddnet] yeah 19:12 <+bridge> [ddnet] @Learath2 but erlang is interesting 19:12 <+bridge> [ddnet] while the syntax sucks 19:12 <+bridge> [ddnet] Everytime I read this channel I see Ryozuki learning/doing random stuff. Should come as no surprise at this stage! 😄 19:12 <+bridge> [ddnet] it solved a real problem 19:12 <+bridge> [ddnet] solves 19:12 <+bridge> [ddnet] * 19:13 <+bridge> [ddnet] > why learn erlang? 19:13 <+bridge> [ddnet] > 19:13 <+bridge> [ddnet] > Erlang is a powerful programming language that is used in many large scale distributed systems. It is used in many industries including banking, telecommunications, e-commerce, and gaming. Erlang provides robust fault tolerant systems and is highly scalable. It is known for its low latency and high throughput. Erlang is also great for developing concurrent, distributed, and real-time applications. It has an excellent set of libraries and 19:13 <+bridge> [ddnet] ill take this as a compliment! 19:14 <+bridge> [ddnet] Yeah I mean it shows you are very enthusiastic and maybe passionate? Idk. 19:14 <+bridge> [ddnet] 19:14 <+bridge> [ddnet] You should be an entrepreneur bro at this stage. Stop working for other people. 19:14 <+bridge> [ddnet] i think thats flawed 19:15 <+bridge> [ddnet] being a entrepeneour would put me far away from real coding 19:15 <+bridge> [ddnet] into managing people 19:15 <+bridge> [ddnet] Erlang does sound interesting 19:15 <+bridge> [ddnet] the motto is, let it crash 19:15 <+bridge> [ddnet] read this https://ferd.ca/the-zen-of-erlang.html 19:15 <+bridge> [ddnet] True but it means you can be your own boss too and you depict your success 🙌 19:16 <+bridge> [ddnet] How's your social life @Ryozuki? 19:16 <+bridge> [ddnet] lul 19:16 <+bridge> [ddnet] Haha 19:16 <+bridge> [ddnet] i have friends i go out with 19:16 <+bridge> [ddnet] hmm thats pretty much it lol 19:17 <+bridge> [ddnet] 👍 19:17 <+bridge> [ddnet] but be careful asking that around 19:17 <+bridge> [ddnet] it rly does seem asked in a offensive way 19:17 <+bridge> [ddnet] xd 19:18 <+bridge> [ddnet] Nah, idea is not to be offensive. Each to their own really. Not judging in any way. Tbh being social able is tiring sometimes. I know my credit card feels the pain 😄 19:19 <+bridge> [ddnet] Nah, idea is not to be offensive. Each to their own really. Not judging in any way. Tbh being socialable is tiring sometimes. I know my credit card feels the pain :smile 19:19 <+bridge> [ddnet] Nah, idea is not to be offensive. Each to their own really. Not judging in any way. Tbh being socialable is tiring sometimes. I know my credit card feels the pain 😄 19:19 <+bridge> [ddnet] oh 19:19 <+bridge> [ddnet] well yeah xd 19:20 <+bridge> [ddnet] anyways gl with your erlang adventures! 🙂 19:20 <+bridge> [ddnet] I think you've convinced learath! 19:54 <+bridge> [ddnet] my solution to part 1 of todays Aoc in brainfuck :) 19:54 <+bridge> [ddnet] ```,[------------------------------------------------[->>>>>>+<<<<<<]>,------------ 19:54 <+bridge> [ddnet] ---------------------------------[--->>>>>[-<<<<++++++++++>>>>]<<<<<[->+<],[-]]> 19:54 <+bridge> [ddnet] >>>>[-<<<<+>>>>]<<<<<<,------------------------------------------------[->>>>>>+ 19:54 <+bridge> [ddnet] <<<<<<]>,--------------------------------------------[---->>>>>[-<<<++++++++++>> 19:54 <+bridge> [ddnet] >]<<<<<[->>+<<],[-]]>>>>>[-<<<+>>>]<<<<<<,-------------------------------------- 19:54 <+bridge> [ddnet] ----------[->>>>>>+<<<<<<]>,---------------------------------------------[--->>> 19:54 <+bridge> [ddnet] >>[-<<++++++++++>>]<<<<<[->>>+<<<],[-]]>>>>>[-<<+>>]<<<<<<,--------------------- 19:54 <+bridge> [ddnet] ---------------------------[->>>>>>+<<<<<<]>,----------[------------------------ 19:54 <+bridge> [ddnet] -------------->>>>>[-<++++++++++>]<<<<<[->>>>+<<<<],[-]]>>>>>[-<+>]>+<<<<<[->>>> 19:55 <+bridge> [ddnet] >>>+<<<<<<<]>>[->>>>>>+<<<<<<]>>>>>[->-[>]<<]<[->>>>>>+<<<<[[-]>>>>[-]<<<<<<<<<< 19:55 <+bridge> [ddnet] [->+<]>>[-<<+>>]<<<<+>>[->-[>]<<]<[->>>>>>>>>>>+<<<<<<<<<<<]<[-<]>>>>>>]>>>>[-<+ 19:55 <+bridge> [ddnet] <<]<<<]<[-<<[-<+>]<<<<+>>[->-[>]<<]<[->>>>>>>>>>>+<<<<<<<<<<<]<[-<]>>>>>>]>>>>>[ 19:55 <+bridge> [ddnet] -]<[-]<[-]<[-]<[-]<[-]<[-]<[-]<[-]<[-]<[-]<[-],]>>>>>>>>>>>>>>++++++++++<<[[->+> 19:55 <+bridge> [ddnet] -[>+>>]>[+[-<+>]>+>>]<<<<<<]>>>>>>>[>]++++++++++++++++++++++++++++++++++++++++++ 19:55 <+bridge> [ddnet] ++++++[<]<<<[-<+>>>>>[>]<+[<]<<<]>[-<<<<+>>>>]<<<[-]<]>>>>>>>[>]<[.<]++++++++++.``` 19:57 <+bridge> [ddnet] help 😄 20:02 <+bridge> [ddnet] did u do it legit or compiled to it 20:03 <+bridge> [ddnet] i did it in c first, only using instructions that are possible with bf 20:04 <+bridge> [ddnet] no compilers 20:14 <+bridge> [ddnet] Wow 20:44 <+bridge> [ddnet] coding in c is like trying to build a sandcastle but only using atoms 21:09 <+bridge> [ddnet] that's assembly, not C 22:01 <+bridge> [ddnet] Whyyyy 22:01 <+bridge> [ddnet] stop 23:07 <+bridge> [ddnet] I agree `.` cleans it up significantly, thanks :) 23:08 <+bridge> [ddnet] today I had an 40 minute exchange with the compiler where I had no idea what it wanted until I gave up and took another approach ^^ 23:09 <+bridge> [ddnet] the compiler messages are still riddles to me, I might be spoiled a little by rust there 23:11 <+bridge> [ddnet] oh wow I only skimmed your solution the last time, I didn't know about `otherwise` yet, thats neat 23:22 <+bridge> [ddnet] yeah, Haskell can challenge Template C++ on that front