• 7 Posts
  • 66 Comments
Joined 3 years ago
cake
Cake day: January 7th, 2024

help-circle



  • I’ll attempt to give a more hand wavey approach, but one that is hopefully easier to understand.

    First, implement:

    \\ find first index of `c` within string `str`.
    \\ returns true if found, sets `out` to result.
    \\ otherwise returns false.
    bool find(char* str, size_t len, char c, size_t* out)
    

    Now this can be used in a loop, where you supply a slice starting at the last line (or the beginning of the slice, on the first iteration), where len is the length of the original string minus the amount of characters consumed (index of the beginning of the slice, relative to the start of the original string).

    Note this requires calculating the string length beforehand, if this is a c-string (as in null terminated).

    This should be relatively simpler to understand and implement than what the standard library supplies, sadly the C standard library is not easy to use or very reliable, so you’ll mostly have to make do yourself.

    I hope this helped, I’m currently away from a computer so i can’t give a code example, good luck.







  • I can see that, personally i dislike using C++, as it has so many different ways to solve the same problem, confining a project to use a specific subset of C++ is very difficult.

    Though mostly what i would like to be closer to other languages, is what is mostly standard across everything, like tuples, so i wouldn’t have to do:

    Err fallible(Arg argument, Out* output) { ... }
    

    But at least attributes allow me to warn if the error in this case is unused.

    Thing is, C can compile to anything, so i wonder if Zig/Rust can really be a drop in replacement in most use cases.



  • Saw a video recently making an argument about how Minecraft is designed with automation in mind, not in a good way, as in it expects you to make an automatic farm for too many resources, which makes exploration redundant.

    The person who made the video made a modpack to revamp the game, instead I’m going to recommend another game i like, and hope you’ll like too, as it respects your time more, even though progression is slow.

    Vintage Story, a hardcore survival, it makes you take more time when progressing, but everything is more meaningful and has more intent.

    As an example, you can make things out of clay, not by simply putting it in a crafting grid, but by molding a few voxels at a time, so you’re most likely to use it to pass the time, if there is need to wait for something to cook/smelt. Same goes to smithing, and cooking, it makes doing chores more fun, you don’t have to hurry to complete the game, just progress a few steps at a time, this makes exploration a core part of the game, and mandatory.

    It’s made with love, and i think that too is very important.


  • I don’t know if I’d assume the same about them, as the way the argument was worded made it seem the new features aren’t a positive, or are broken in some way, or at least gave the appearance of the actual reason being technical and not skill.

    I was originally thinking of the use case for C is when you need to have something in a closed ecosystem, as in no dependencies, so generics made sense as an example, and while I’m aware one can use rust, it usually enables (and in a sense encourages) pulling in many dependencies, which is not always desirable.









  • I’d say 2001 and 2006 purely because the scrollbar is textured in a way that make it seem dragable at first glance |=|.

    Which is standard by now but still, besides that 1998 has all the other visual cues to denote what’s clickable and i would otherwise agree as i generally prefer flatter designs.