[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Maintenance is complete! We got more disk space.
Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
>> No.73903294

this one is based
pedoshit is still shit

>> No.73903334
File: 42 KB, 446x373, 1428905540694.png [View same] [iqdb] [saucenao] [google] [report]

>wake up for aoc
>really want to sleep
>tomorrow is monday. I should use weekend to get some sleep and not do stupid aoc
>it will be one more "use computer from olden day" task anyway and take hour or so
>get some good sleep
>wake up to task I could have solved and went back to sleep without any issue

When will I learn. Same happened few times last year

>> No.73903341

wow. day 8 is shit even as a placeholder for real day 8 picture.

>> No.73903343
File: 20 KB, 753x197, stats.png [View same] [iqdb] [saucenao] [google] [report]

Looks like day 7 part 2 was the first decent filter

>> No.73903366
File: 44 KB, 960x500, Screenshot_2019-12-08 Screenshot.png [View same] [iqdb] [saucenao] [google] [report]


>> No.73903372

That jump from 2->3 is pretty steep too.

>> No.73903418
File: 53 KB, 200x200, 1322179860670.png [View same] [iqdb] [saucenao] [google] [report]


>tfw filtered

One more try today for day 7, and if it doesn't work, time to die

>> No.73903438

>i want on the leaderboard
>but i don't want to get up early
This isn't twitter, faggot.

>> No.73903479

>day 10: intcode registers
>day 12: intcode interrupts and traps
>day 15: multi-core intcode
>day 18: intcode delay slots
>day 20: static branch prediction
>day 25: superscalar intcode pipeline with dynamic branch resolution

>> No.73903488

>not aiming for a good score
>sets alarms to wake him to boot machine up before it starts
You're all over the map mate. Get your sleep, work your job and do it when you come home. There, I simplified your life.

>> No.73903497

I got filtered ;_;

>> No.73903501

By which challenge?

>> No.73903510

oh fuck off. I am not delusional enough to think I will global points.
Trying to mock me for wanting to try work on task with everyone else when it is released will not work.
Drink your hrt pills and KYS. Here I simplified yours.

>> No.73903513

most pathetic cope ive seen in this thread
just get filtered with some dignity for gods sake

>> No.73903514


>> No.73903565

a PPM file is easier to print than "just char == '0'", because you don't have to break up the lines. It's just three lines of header and then a pixel per line.

>> No.73903603

it's literally faster to write out a pbm file than to mess about with ascii, you autist

>> No.73903612

if you say so

>> No.73903675

>day 25
>write an image parsing progam that accepts a byte array of an image of an anime girl and determines if the person posting it is a tranny

>> No.73903697

nah that's why it's a day 25 task. it's always an easy silver star and then "get all the other stars" for gold.

>> No.73903713

>intcode traps
finally a good use for intcode

>> No.73903744

Nice fibonacci. I wish we could extend the tape and be turing complete

>> No.73903747

Now implement the sieve of Eratosthenes in intcode

>> No.73903809

Fuck, you're right. But it would be miserable to write an arbitrary program. Now I've got to implement the ackermann function.
It would sure be a lot easier if we had a modulo instruction though.

>> No.73903821


>> No.73903989

NGL I really want this

I really really enjoy writing emulators and VMs quite a lot, I wish it were my job.

>> No.73904013

Somebody write an intcode program that outputs another intcode program.

>> No.73904034


>> No.73904164

Why did he put such an easy problem on a sunday. If i get a problem like day 7 during the week Im gonna be filtered.

>> No.73904168
File: 876 KB, 792x1202, APL.png [View same] [iqdb] [saucenao] [google] [report]

Oh sorry, I forgot to include the file name.
It's day 8.

>> No.73904192

was wondering the same.
maybe to give people some time to catch up.

>> No.73904246

>people who reinvent the wheel instead of using standard features, making their lifes harder for no reason

>> No.73904252

>I feel like 75% of the reason people ̶p̶o̶s̶t̶ ̶t̶h̶e̶i̶r̶ code is just to show whatever crappy anime girl wallpaper they have in the background

>> No.73904286

day 8 is way too easy and should have been day 1 or 2

>> No.73904308


>> No.73904314

Nice use of the Semigroup abstraction.

>> No.73904364
File: 102 KB, 798x859, 2019-12-08-115929_798x859_scrot.png [View same] [iqdb] [saucenao] [google] [report]

This was so easy I feel bad even posting my code

>> No.73904376
File: 18 KB, 480x360, hqdefault.jpg [View same] [iqdb] [saucenao] [google] [report]

Remove the pedo porn, get rid of whatever the fuck day 8 is and replace day 7 with this

>> No.73904392

day 8 part 2 condensed
val (w,h) = (25,6)
println(s"P1 $w $h")

.foreach {_.dropWhile{_=='2'} match {
case Seq('1',_*) => print(0)
case _ => print(1) }}

>> No.73904393

That's not accurate, there is no megaphone going into Bart's ass and completing the feedback loop

>> No.73904406

Imagine being this guy >>73904390

>> No.73904423

I wonder why D lacks popularity. I've been looking at it and it looks pretty comfy. An almost perfect best of all worlds compiler language, but barely anyone seems to be using it.

>> No.73904436

Programming is still mostly male-dominated and it's hard to sell men on the D

>> No.73904460


>> No.73904480

My zero/ones string is wrong. I checked with another anons input and my programs seems correct. Am I supposed to insert newlines?

>> No.73904553

I'm gonna redo day 7 using JS and promises because I hate myself

>> No.73904567

>7k to 1k
What the fuck? Part 2 was almost easier than part 1.

>> No.73904568
File: 256 KB, 1286x1600, skeleton-with-gun-57f542733162a.jpg [View same] [iqdb] [saucenao] [google] [report]

Thanks anons. Am I the only one unable to figure this out?
I even tried to submit the answer for the test input instead of my real input five times.
This filtered me.

>> No.73904581

it confused me for a bit too, i thought id have to get some image library to convert binary to to image but then realised i can just print it to console with newline for each row

>> No.73904674
File: 70 KB, 790x857, file.png [View same] [iqdb] [saucenao] [google] [report]

huh interesting
i didnt expect i would be that high in day 1 considering i didnt even know about it until 3 hours after it opened
i guess theres a lot of shitters

>> No.73904739
File: 140 KB, 450x399, babu.jpg [View same] [iqdb] [saucenao] [google] [report]

ship it

>> No.73904791

its funny you wet blanket

>> No.73904804
File: 15 KB, 184x184, Contempt.jpg [View same] [iqdb] [saucenao] [google] [report]

kys, and leave day 6 alone

>> No.73904821
File: 66 KB, 298x256, 3de15456f774fbb586987fe2bebf2c7583412bee.png [View same] [iqdb] [saucenao] [google] [report]

I can't believe how much I pajeeted today.

width = tonumber(arg[2])
height = tonumber(arg[3])

layers = {}
layer = {}
row = {}
for x in io.open("d08_input.txt"):read("a"):gmatch("%d") do
table.insert(row, tonumber(x))
if #row >= width then
table.insert(layer, row)
row = {}
if #layer >= height then
table.insert(layers, layer)

>> No.73904884
File: 3.11 MB, 4657x2499, calendar.png [View same] [iqdb] [saucenao] [google] [report]


>> No.73904978

So is day 6 you wet blanket.

Not helping your case.

>> No.73905004
File: 173 KB, 960x1280, Coke Bird.jpg [View same] [iqdb] [saucenao] [google] [report]

I started trying to learn Haskell in maybe 2018, April? My drug abuse started that August?

Last year's AoC helped a whole fuck ton with furthering both...

>> No.73905020

slightly improved
val (w,h) = (25,6)
println(s"P1 $w $h")

.foreach {_ find {_!='2'} match {
case Some('1') => print(0)
case _ => print(1) }}

$ image-viewer <(scala p2.scala <in)

>> No.73905023

hey, where did you learn that tacit programming? I'm really confused by composition @/@:/&/&: in contrast to "capping" with [:

>> No.73905131

No big boy?

>> No.73905134

The other way around, the first layer is the top one, so you can just update that one

>> No.73905168
File: 459 KB, 768x1024, 49c3ba89e41ce9d911c55f855a5f4b8bbe199ce5.jpg [View same] [iqdb] [saucenao] [google] [report]

Well I hope I'm as good as you in a year.

Enjoy your addiction and your code.

>> No.73905336

your pic contradicts that

>> No.73905405


>> No.73905440

seconded, remove the anime crap and get the real content in here

>> No.73905482


>> No.73905648

>37 numbers
here's a quine with 27 numbers of code

>> No.73905725
File: 1.10 MB, 2894x4093, kamindani EKoO9x1U8AAu_Rj.jpg [View same] [iqdb] [saucenao] [google] [report]

Mine includes code to display commas (once generally and once for the counter) + additional end-of-file handler that doesn't display the comma, but still nice.

>> No.73905894

>get all black in p2

>> No.73905931

>go to reddit aoc
>there aren’t any pedos or drug addicts

>> No.73905945

see https://rbt.asia/g/thread/73865945/#73869322

>> No.73905949
File: 1.62 MB, 1002x1446, carbon (2).png [View same] [iqdb] [saucenao] [google] [report]


Got bored. Did Day 7, 2017.

>> No.73905970
File: 252 KB, 1000x1376, Megu Love.jpg [View same] [iqdb] [saucenao] [google] [report]

Do you have your solution to it?
I'd love to see other people's approaches.

>> No.73905981

I mean if you think implementing permutations is a big accomplishment, go for it. For me it's std::next_permutation

>> No.73905986

Why? I have female coworkers and they aren't like this at all. Is it a California thing?

>> No.73905988
File: 450 KB, 1500x1500, Drunk Chibi.jpg [View same] [iqdb] [saucenao] [google] [report]

Your home :^)

>> No.73905989 [DELETED] 

not him but here's mine https://pastebin.com/raw/LrASUwMR

>> No.73906041
File: 10 KB, 413x145, df360673dba9b7b4da522af3e4c5fe378ef774c9.png [View same] [iqdb] [saucenao] [google] [report]

>> No.73906051
File: 223 KB, 837x391, carbon.png [View same] [iqdb] [saucenao] [google] [report]

Not a true quine!

Anyway, here's my spaghetti day 8.

>> No.73906085

>Not a true quine!

>> No.73906154 [DELETED] 

Day 7.2 big boy: https://pastebin.com/a0LtBP0R

>> No.73906190
File: 283 KB, 1628x2348, carbon.png [View same] [iqdb] [saucenao] [google] [report]

Variant of the Haskell solution above.

>> No.73906256

Day 8.2 BIG BOY https://pastebin.com/a0LtBP0R

>> No.73906257
File: 8 KB, 376x205, file.png [View same] [iqdb] [saucenao] [google] [report]

Bigboy a shit

>> No.73906268

>error C2026: string too big, trailing characters truncated

Bruh I hate how I can't just paste a bigboy in to a c++ file.

>> No.73906272

>222222....22222[actual data]
You fucking retarded gorilla nigger

>> No.73906326


Sorry, dimensions are 31x6, I'm a failure

>> No.73906344

I mean sure but I really don't want to do file IO for what is just auto in = "stuff";

>> No.73906346

Still way too small for a bigboy

>> No.73906349
File: 286 KB, 850x850, Speaking.png [View same] [iqdb] [saucenao] [google] [report]

is that part1?

>> No.73906356

yes and yes
looking at part 2 right now

>> No.73906363

>a quine's output has to be exactly its source code
if you run output.join() on the output of your machine, you will get the exact source code for the quine
it's your choice how to implement output and if I wish to implement output separated with commas then it's a quine I think

>> No.73906376

Today's challenge was easy, bring back intcode

>> No.73906443
File: 851 B, 210x101, faggot.png [View same] [iqdb] [saucenao] [google] [report]

How do I make my output more aesthetic?

>> No.73906457

he's giving you the day off so you can hang out with your friends or your significant other.

>> No.73906459

Get rid of the retarded line spaces. If you use a meme ouput device like some 70s console use a double height character for printing.

>> No.73906463
File: 67 KB, 863x678, difficulty.png [View same] [iqdb] [saucenao] [google] [report]

I don't know, I feel like last year's challenges were too hard

>> No.73906505

Which terminal?

>> No.73906531

I'm just using a normal Windows Command Prompt and printing out the full block unicode character (U+2588)

>> No.73906708
File: 313 KB, 500x550, 1544453719537.png [View same] [iqdb] [saucenao] [google] [report]

It felt like todays problem was made for numpy so it's the first time I used a non standard Python lib.
Although it feels like numpy might as well be a standard lib at this point.
I don't aim for leaderboard but even on easy days like this it takes me like half an hour to code up a solution. I always knew I wasn't exactly fast but idk what I'm even doing. I start a few hours later anyways so its not like it matters though.

Pic related is me when I read peoples Haskell solutions.

>> No.73906714

Bigger bigboy, since that one is boring
And if your program was able to handle that, here is the final bigboy (does not fit in memory):
for i in $(seq 1 29); do cat nig2 >> otherfile; done
cat otherfile otherfile >> realbigboy

>> No.73906735
File: 5 KB, 212x106, file.png [View same] [iqdb] [saucenao] [google] [report]


>> No.73906833
File: 13 KB, 439x113, file.png [View same] [iqdb] [saucenao] [google] [report]

Here are my results.
Answer for the first part is 584 for both. Second part you should be already familiar with.

>> No.73906838
File: 379 KB, 1514x1886, file.png [View same] [iqdb] [saucenao] [google] [report]

code could be cleaner but its not the worst. anyone got any "images" to post?

layers below shouldnt overwrite layers on top

>> No.73906934 [DELETED] 

part 2, kinda eh
import collection.{mutable => m}

case class Node(id: String, w: Int) {
val kids = m.ArrayBuffer.empty[Node]
lazy val allw: Int = w + kids.map{_.allw}.sum

def postOrder: Iterator[Node] =
kids.iterator.flatMap{_.postOrder} ++ Iterator(this)

val root = {
val ns = m.Map.empty[String,Node]

>> No.73906953

>>73906320 (You)
part 2, kinda eh
import collection.{mutable => m}

case class Node(id: String, w: Int) {
val kids = m.ArrayBuffer.empty[Node]
lazy val allw: Int = w + kids.map{_.allw}.sum

def postOrder: Iterator[Node] =
kids.iterator.flatMap{_.postOrder} ++ Iterator(this)

val root = {
val ns = m.Map.empty[String,Node]

>> No.73907047

For me, filtered is not being to finish the puzzle in a reasonable time, so usually under 24 hours and|or when you give up.

>> No.73907076

Where are my Lisp bros???

>> No.73907087

Stuck on day 2

>> No.73907230
File: 259 KB, 1750x1058, carbon (5).png [View same] [iqdb] [saucenao] [google] [report]

Improved Haskell after realizing there was a list chunking function in the split package, which I'm using because the Haskell stdlib bizarrely lacks a function to split a string on a delimiter.

>> No.73907290

Based. I need to use the algebraic typeclasses more

>> No.73907409

I'm gonna do day 9 from the hospital
I'm literally gonna solve an aoc problem from my phone

>> No.73907588

Getting my gallbladder removed
I expext the great filter to drop day 11, tomorrow is another intcode bullshit for sure
My last laptop died in 2009 and I never bothered replacing it because I have a proper desktop

>> No.73907614

It's day 25, you just had to implement your 99th intcode instruction. Now the puzzle asks you to add another mode a number of instructions have to handle. How fucked are you?

>> No.73907634
File: 158 KB, 812x929, Screenshot 2019-12-08 at 17.36.21.png [View same] [iqdb] [saucenao] [google] [report]



>> No.73907656

Living the c++ STL life is suffering. It really misses views and ranges.

>> No.73907661

Can someone please explain to a retard like me what does part 2 of day 2 ask?

>> No.73907676

Almost none of the text matters, read it ignoring the bulk and it becomes understandable.

>> No.73907755

Understandable, this problem was almost day01-tier

>> No.73907770

ah so only position 1 and two. I thought it was position 1 and two after every opcode.
thanks anon

>> No.73907779

thanks bros

>> No.73907787

you can always use range-v3 to prevent brain damage

>> No.73907798

he doesn't need them, it's already turing complete.

>> No.73907860

I have my aoc2019 directory. Inside that I have a directory for each day (day1, day2, etc.), inside those I have the input and solution for each challenge. Rather than changing into the directory before executing the script, I'd like to execute the script inside the aoc2019 e.g. python day1/day1.py. However if you just specify "input.txt" as the filepath for open, it will attempt to open the file "aoc2019/input.txt". Like I said it can be solved by using "sys.path[0] + "//input.txt" as the filepath but I was wondering if there's a clean way to do it without any imports.

If not it doesn't matter too much since I'm not really using imports for the actual solution.

>> No.73907941

CHALLANGE: implement subtraction and division IntCode routines
HARDER CHALLANGE: implement integer exponentiation and logarithms

>> No.73908042

There's literally a link in the OP to the challenge

>> No.73908223
File: 13 KB, 571x426, file.png [View same] [iqdb] [saucenao] [google] [report]

the visual for this year kind of sucks. 2017 was obviously the best (maybe 2018, i haven't done it - can anyone post it?)

>> No.73908271

God today's challenge has got to be the easiest one so far.

>> No.73908338

Do you not remember days 1 or 4?

>> No.73908343

Wrote it on the browser's console so don't bitch to me about it
Feels easier than this year's day 7

>> No.73908345

One nice touch is that it highlights the planet you're on, for example Mars had square brackets around it before you solved the problems for today.

But I do agree, this year's calender visuals have been a bit boring so far.

>> No.73908367

Are you advancing the index when you print '\n'? If so, each new row will be skewed by one element. When you reach the width, print \n, and, without advancing the index, print the next one too.

>> No.73908442

First I made a list of layers, and then for every pixel iterate through each layer for info about that pixel and estimate what comes up and just add it.
Ultimately when writing it out I just do a for loop for each character of the final image string and if i%25 and i!=1 or 0, then just add line break.

>> No.73908443

Are you doing it backwards?

>> No.73908465

Why? The solution doesn't indicate the trouble I had reaching it. iirc I got tripped up on the description and was trying to calculate the fuel for the fuel after my part 1 solution and couldn't get it to work until I rewrote my part 1 solution to calculate the fuel for fuel at each step of the way.

Today's solution was far more easier and straightforward to reach for me.

>> No.73908471

>if i%25
0 % 25 = 0.
See >>73908406

>> No.73908475

>unique C# feature
>specialized query language!
in D this is just normal code...
mport std;

struct Solution {
int day;
int part;

const Width = 25;
const Height = 6;
const CharPerLayer = Width * Height;

>> No.73908491

you can do

if (i % 25) == 0 {

if layer == 0 {
print(" ")
else if layer == 1 {

>> No.73908516

also, 4chan swallowed my black marker, the last print("") should be print(whatever white is)

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.