• 0 Posts
  • 37 Comments
Joined 1 year ago
cake
Cake day: July 9th, 2023

help-circle

  • Self-replying to add a couple other classics that aren’t already in the thread:

    • Penguin Land: A Mr-Driller-like puzzler where you are trying to carefully bring an egg safely to the end of the level - but it can only fall one block distance without breaking. Also, there are polar bears you can crush with boulders.

    • Zillion: This game has no business being as good as it is. Side scrolling adventure game where you are tasked with rescuing your captured spy-buddies. You have to loot secret codes from the bodies of fallen enemies, use them to unlock laser doors and progress further into the enemy base. It uses exceptionally large and detailed sprites for the time and is a surprisingly “mature” game for the Era. (Not meaning nudity, just that it is more interesting to someone auth the patience to map out a base and write down secret codes)

    Skip the sequel, however. Zillion 2 sucked. a lot.



  • GOLVELLIUS

    This game is a blatant… homage to OG Legend of Zelda. But IMHO it does almost everything better.

    The game begins with Link Kelesis entering a cavern where an old woman tells him to take a sword - and some boots because our boy can’t even dress himself.

    After that, you know the drill. Top-down action rpg mode, slaying monsters, leveling up, finding secrets and better equipment.

    Where it improves on the original LoZ is that the Master System was more powerful than the original NES, so the graphics here are brighter and more detailed and the audio is crisper.

    The structure of the world is more linear than LoZ - but that means it’s a lot harder to get lost. Also, as you unlock gear and powers you can backtrack to discover new secrets in old locations.

    The game’s characters vary wildly in tone from angry old ladies berating you for lacking the funds to shop to meandering fairies commenting on snow cones.

    I replay Golvellius every few years on whatever the handheld platform dujour is. …I think it’s about time to give out a spin on the steam deck again.

    Anyway. If you like that classic Zelda vibe, give Golvellius a spin. It’s seriously one of the best games I played on the old Master System.




  • Classes are Data plus the code required to modify that Data. The idea is to encapsulate data modifications into one thing (a Class) that knows how to modify all the Data as a single unit. This lets us write some code to describe, say, a Scrollbar widget. The Class for the widget combines all the Data for a Scrollbar (position, orientation, bar size, total size, etc) with the methods that read or modify that data (scroll up/down, change size, draw, etc).

    That’s the first Big Idea of OOP - that data should be grouped with the functions that modify it. If you don’t have that - as in C - you have to write functions that only work on a given data type but which are namespaced separately. You get functions like void set_scrollbar_pos(void* scrollbar, word pos) which become verbose in a large project. (I’m not saying this is the worst thing in the world, just a different style.)

    The second Big Idea of OOP is message passing. Now that we have code and Data bundled together, it would be nice if Objects that share functions of the same essential type and intention could be swapped out interchangeably. So instead of directly invoking a function on an Object, we send a ‘message’ that says something like ‘if you know how, please draw yourself on screen, relative to X,Y’.

    Of course, since plain English is hella verbose, the actual message is going be something like “draw, X,Y” and the Object receiving the message then sorts out if it has a method called “draw” that can use the provided X and Y. If so, it runs the code to do so. If not, you get an error.

    Messages like this mean that you can swap out compatible Classes for one another. E.g. you can ask any collection of widgets to .draw themselves with a single method and let the compiler/interpreter generate the machine code as needed. That reduces the amount of boilerplate for engineers by a lot! Otherwise, trying to work with any collection of heterogeneous Objects (like a List of every Widget contained in a Window) would need to have essentially the same code rewritten for every different Type needed - a combinatorial explosion of code!

    Tl;Dr -

    • Classes help organize code and simplify state management by combining data with the functions that manipulate that data.

    • Classes reduce the amount of boilerplate code needed by allowing methods with the same “shape” to be called interchangeably.

    Everything else about OOP is essentially built off these two ideas. I hope that helps.





  • Once upon a time, I built a proof of concept distributed social network that ran entirely on cell phones.

    I eventually ran into enough complications that I abandoned the project. But the tech did work. I could create posts, add friends, etc. (It just wasn’t reliable in its sync mechanism and I gave up trying to fix it.)

    So… Imagine Lemmy, but a community’s data is stored collaboratively on mobile devices, the load shared by all its subscribers.

    We all walk around with goddamn supercomputers in our pockets. We should put them to work.



  • Generally, some algorithms are more easily expressed as recursive functions than iterative loops. …and vice versa. And realistically, that’s how you should choose ninety nine percent of the time.

    But if you want to get into the weeds… Prefer iteration unless you know one or more of the following:

    • Your maximum iteration depth is bounded and cannot overflow your machine’s stack depth.
    • Your algorithm can be implemented with tail-call recursion AND your language supports the same.
    • Your senior/team lead wants a recursive solution.

    Because in environments where none of the above are true, iterative solutions are usually more performant, safer, and better understood.


  • Programming success is more closely associated with language skills than math skills.

    Yes, if you need to invent a new algorithm you’ll need math. Computer Science is definitely mathematics heavy.

    But writing a program is all about expressing your intent in a programming language, step by step. It’s about “communicating” with the machine (and your users).

    All this to say, I got C- and D grades in my math courses in college and still became a successful computer programmer. I’m not pushing the boundaries of computation, but if you need an app for your business, I can build that for you in a reliable, tested, and flexible manner.

    Edit: Also! I love Common LISP. It’s such an amazing language and I’m so sad that it isn’t more popular in the industry.






  • Aw man, you can’t write all that and then not give an example!

    Ruby makes scripting drop-dead simple. You can run any shell command by surrounding it with back ticks.

    # simple example, just grab files: 
    files = `ls`.split("\n")
    
    # pipes work inside back ticks
    files.map {|f| `cat #{f} | grep "can I use grep w/out cat"`}
      .compact
      .each { |match| puts match }
    # easy to build a pipeline on the data in ruby, too! 
    

    That’s it! No messing around with popen3, or figuring out pipes or signals. Those are there too if you really need them, but if you just wanna write a quick script with a less arcane syntax - try Ruby!


  • I loved (and still do) the rush of solving the puzzle. Programming languages give you a constrained set of rules to express yourself with. And yet we know that you can create literally anything with those rules if you can just put them together in the right way.

    I love when a program actually comes together and it works for the first time! When I’ve started from nothing but a vague desire and then pulled a solution from out of the void. It’s as close to actual magic as anything else I can think of.

    I compel lightning and stone to my will, commanding them in unspoken tongues.