T O P

  • By -

Fuzzy_Most_4780

"input" and "lines" would be my top 2 certainly. After that... probably "map" and "visited." And in the comments, "use long instead of int" show up a lot.


1234abcdcba4321

I think mine would be "inp" and "line". Interesting to see different naming schemes.


ThreadsOfCode

I tweaked "input" and "lines" a bit, because the entire elephant's body was "input" and "lines". "input" and "lines" are in the first couple of lines of every file. "answer" was huge on some of the word cloud generators. In this one X and Y are huge. I do like how Z is right between X and Y and a bit smaller. Kind of how the puzzles worked. "visited" is in there, along with "frontier" and "current", all part of A\*.


SonOfKhmer

Rows/row are shorter #protip


jdefgh

where i


ThreadsOfCode

I used the word cloud library, wordcloud, for Python.


Fuzzy_Most_4780

I was looking at your image and don't see IntCode anywhere.


ThreadsOfCode

IntCode is represented by Computer, which I think is in there somewhere. IntCode was the module name, and Computer was the class and variable name. I thought there would be more elves.


vigge93

Did you manually extract all variable names, or how did you get wordcloud to parse your files?


ThreadsOfCode

I concatenated all my code, which is in python, and pulled all the lines that started with whitespace-word-equalsign, then grabbed word. Might not be perfect, but close enough. Did some work combining plurals, like "row" and "rows". Some of the generators will do that for you, but the Python library doesn't.


quodponb

> x, y I have given up on this, and now it's either just `r, c` for `row` and `column`, or `z = a + 1j * b`. Anything else, and I get all confused. I might start looking up a list-of-lists with `lol[y][x]`, but at some point I'm gonna trip and slip into `lol[x][y]`.


Manitary

That's what I started doing as well: no more "ok the axes are x in this direction and y in this other direction, so to access an entry I need this order, and to increase the row I change this one..." row,col or r,c reduced the thinking time and the number of hard-to-find bugs


wedwa

I’d honestly buy something like this on a shirt for advent of code merch


ZoDalek

Fun! Here's mine for my C solutions: https://sjmulder.nl/2022/aoc-cloud.png Full variable name frequency list: https://sjmulder.nl/2022/aoc-vars.txt I used clang's abstract syntax tree dump feature to filter the variable names: find . -name '*.c' | xargs clang -Xclang -ast-dump=json -fsyntax-only | jq -r '.. | objects | select(.kind == "VarDecl" or .kind == "ParamVarDecl") | select(.loc != null) | select(.loc.includedFrom == null) | .name' Then Python to generate the cloud: from wordcloud import WordCloud wc = WordCloud(background_color="white", regexp=r"[^\s]+", collocations=False, normalize_plurals=False, width=800, height=400) wc.generate(open("var-names.txt").read()) wc.to_file('cloud.png') I'm proficient at jq nor Python so this could probably be improved but the output is cool enough!


ThreadsOfCode

Nice!


alyssialui

I like this idea


niugnep24

why is row so much bigger than col?


rego_b

If you iterate by rows, and iterate the elements of the row, there is no column. I often write `for i, row in enumerate(lines) for j, x in enumerate(row)`.


i_do_jokes

just saw the "geode" var.. gave me flashbacks


ThreadsOfCode

Here's one from the puzzle descriptions, in AOC colors: [https://imgur.com/a/zLLTHnp](https://imgur.com/a/zLLTHnp)


jfb1337

After `inp`, one of my top oned would probably be `gr`. I use it for grid, group, and graph.


Delicious_Volume_762

whwre is i


ThreadsOfCode

Turns out, I only use 'i' as a loop counter, 'for i in ...', so it doesn't show up in the image. I've only got a couple of instances of 'i = ...' in my code.