Quantcast
[ 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

>>73903277
this one is based
pedoshit is still shit

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

>>73903267
>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

>>73903267
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]
73903343

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]
73903366

>>73903343

>> No.73903372

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

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

>>73903343

>tfw filtered

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

>> No.73903438

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

>> No.73903479

>>73903409
>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

>>73903472
>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

>>73903497
By which challenge?

>> No.73903510

>>73903488
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

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

>> No.73903514

>>73903472
>>73903510
triggered.gif

>> No.73903565

>>73903551
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

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

>> No.73903612

>>73903603
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

>>73903688
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

>>73903479
>intcode traps
finally a good use for intcode

>> No.73903744

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

>> No.73903747

>>73903617
Now implement the sieve of Eratosthenes in intcode

>> No.73903809

>>73903780
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

>>73903479
lel'd

>> No.73903989

>>73903479
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

>>73904013
104,99,99

>> No.73904164

>>73901423
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]
73904168

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

>> No.73904192

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

>> No.73904246

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

>> No.73904252

>>73904229
>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

>>73904272
https://en.wikipedia.org/wiki/Heap%27s_algorithm
https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm

>> No.73904314

>>73904127
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]
73904364

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]
73904376

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

>> No.73904392

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

io.Source.stdin.getLines.next
.grouped(w*h).toSeq.transpose
.foreach {_.dropWhile{_=='2'} match {
case Seq('1',_*) => print(0)
case _ => print(1) }}

>> No.73904393

>>73904376
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

>>73904364
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

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

>> No.73904460

>>73903366
link?

>> No.73904480

WHAT THE FUCK IS A MESSAGE from pt2?
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

>>73904543
>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]
73904568

>>73904513
>>73904517
>>73904546
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

>>73904568
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]
73904674

https://aocpercenter.marcolussetti.com/
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]
73904739

>>73904502
ship it

>> No.73904791

>>73904781
its funny you wet blanket

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

>>73904376
kys, and leave day 6 alone

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

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)
</wbr>

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

CALENDAR
>CALENDAR
CALENDAR
>CALENDAR
CALENDAR
>CALENDAR
CALENDAR
>CALENDAR

>> No.73904978

>>73904791
So is day 6 you wet blanket.

>>73904804
Not helping your case.

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

>>73904842
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

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

io.Source.stdin.getLines.next
.grouped(w*h).toSeq.transpose
.foreach {_ find {_!='2'} match {
case Some('1') => print(0)
case _ => print(1) }}

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

>> No.73905023

>>73904139
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

>>73905115
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]
73905168

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

Enjoy your addiction and your code.

>> No.73905336

>>73905324
your pic contradicts that

>> No.73905405

>>73905218
>hebephilia.png

>> No.73905440

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

>> No.73905482

>>73905453
No

>> No.73905648

>>73905572
>37 numbers
here's a quine with 27 numbers of code
4,0,1001,1,1,1,1008,1,1,26,1005,26,21,1007,1,27,26,1005,26,0,99,104,0,1105,1,2,1

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

>>73905648
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
nani

>> No.73905931

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

>> No.73905945

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

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

>>73905752
/shrug

Got bored. Did Day 7, 2017.
https://adventofcode.com/2017/day/7

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

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

>> No.73905981

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

>> No.73905986

>>73903447
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]
73905988

>>73905931
Your home :^)

>> No.73905989 [DELETED] 

>>73905970
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]
73906041

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

>>73905985
Not a true quine!

Anyway, here's my spaghetti day 8.

>> No.73906085

>>73906051
>Not a true quine!
elaborate

>> 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]
73906190

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]
73906257

>>73906154
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

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

>> No.73906326

>>73906272
:^)

>>73906257
>>73906288
Sorry, dimensions are 31x6, I'm a failure

>> No.73906344

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

>> No.73906346

>>73906326
Based
Still way too small for a bigboy

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

>>73906320
scala?
is that part1?

>> No.73906356

>>73906349
yes and yes
looking at part 2 right now

>> No.73906363

>>73906109
>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]
73906443

How do I make my output more aesthetic?

>> No.73906457

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

>> No.73906459

>>73906443
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]
73906463

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

>> No.73906505

>>73906498
Which terminal?

>> No.73906531

>>73906505
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]
73906708

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

>>73906256
Bigger bigboy, since that one is boring
http://www.mediafire.com/file/q9q9jzkgha9zgcd/nig2/file
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]
73906735

FUCK

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

>>73906714
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]
73906838

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

>>73906735
layers below shouldnt overwrite layers on top

>> No.73906934 [DELETED] 

>>73906320
>>73906349
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)
>>73906349
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

>>73906886
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

>>73907076
Stuck on day 2

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

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

>>73906190
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

>>73907432
Getting my gallbladder removed
>>73907436
I expext the great filter to drop day 11, tomorrow is another intcode bullshit for sure
>>73907545
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]
73907634

>>73907121

nice

>> 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

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

>> No.73907755

>>73907713
Understandable, this problem was almost day01-tier

>> No.73907770

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

>> No.73907779

>>73907676
>>73907695
>>73907700
>>73907732
>>73907765
thanks bros

>> No.73907787

>>73907656
you can always use range-v3 to prevent brain damage

>> No.73907798

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

>> No.73907860

>>73907750
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

>>73908014
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]
73908223

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

>>73908271
Do you not remember days 1 or 4?

>> No.73908343

>>73905970
https://pastebin.com/CEgmyaP2
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

>>73908223
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

>>73908331
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

>>73908367
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

>>73908331
Are you doing it backwards?

>> No.73908465

>>73908398
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

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

>> No.73908475

>>73907823
>linq
>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

>>73908442
you can do

if (i % 25) == 0 {
println("")
}

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

>> No.73908516

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

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
reCAPTCHA
Action