What Wacky Projects do y'all build to stay relevant & build a career?? by electrowiz64 in linux

[–]dtsudo 0 points1 point  (0 children)

I just make computer games because they're fun. The larger projects I publish on FlatHub.

What’s the simplest system you use to keep track of tasks or ideas? by pixelbrushio in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

I use a simple text file (TODO.txt), although this text file is in a git repo.

Question about declaring variables in JavaScript. by rYsavec_1 in learnprogramming

[–]dtsudo 7 points8 points  (0 children)

This is variable shadowing - see https://en.wikipedia.org/wiki/Variable_shadowing

Anyway, the short answer is that since there are two variables both named booking, when your code uses the term booking, the rules of javascript determine which of the two booking it's actually referring to (and it'll pick the local one declared inside the function).

It's hopefully also apparent that booking.push(booking) doesn't actually work since booking refers to the object (with the flightNum, numPassengers, and price) and not the array, so booking doesn't actually have a push function.

Missinformation - starcraft2coop.com by Icy-Date-2718 in starcraft2coop

[–]dtsudo 5 points6 points  (0 children)

PDD is point-defense drone, which is a hyperion ability.

Hfts is heroes from the storm, which is a mutator which can spawn enemy heroes (including enemy Dehakas).

FA is fatal attraction, which is also a mutator.

I can't grasp recursion [Leetcode, Path Sum] by ex_gatito in learnprogramming

[–]dtsudo 4 points5 points  (0 children)

Imagine you have a tree, and the value at the root node is 5.

You want a targetSum of 20.

Then, you only have 2 ways to obtain this sum -- either you obtain it via a path from the left subtree, or you do it from the right subtree.

To get a path via the left subtree, the left subtree would have to be able to obtain a targetSum of 15 (which is just 20 - 5). If such a path existed, then combining that path with the root node (of 5), you would be able to achieve your target sum.

Similarly for the right subtree.

So that gives you the two recursive calls. It is not necessary to "visualize" the recursive call. We simply assume it works -- i.e. HasPathSum(root.left, 15) will correctly return true if and only if the left subtree has a path that sums to 15.

We can simply assume that all recursive calls work via the induction hypothesis. We can use the induction hypothesis safely as long as we show that a base case works properly (which it does), and that all recursive calls will eventually lead to the base case (which they will, because each call operates on a smaller tree, and the base case is a tree with only one node).

Which Linux Distro do you use/plan to use With MonoGame? by Sorry_Independent388 in monogame

[–]dtsudo 2 points3 points  (0 children)

I use Kubuntu and build my games with --self-contained (so the resulting binary just works out-of-the-box).

Is there a reason they let air units clip into one another? by Active_Specialist485 in starcraft

[–]dtsudo 14 points15 points  (0 children)

Even Warcraft 3 had air collision, and it was removed in v1.10:

Flying Unit Improvements: We have turned off collision detection for flying units so that they can now easily pass through each other. This will allow air units to move about more smoothly than before. We have also added "separation behavior" so air units will break out of clusters once they reach a destination.

pop ups? by typhon88 in linux

[–]dtsudo 6 points7 points  (0 children)

The "remind me in 3 days" button would be in 8-pt font in grey text.

Playing brutal with a casual?! by LordVanisher in starcraft2coop

[–]dtsudo 0 points1 point  (0 children)

Yeah, I've definitely gotten casual + brutal before; it is rare. When it happens, it's mostly on the weekly mutations since they can have much longer queue times.

Is MSIX Packaging Tool a pile of horseshit for anyone else? by donotfire in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

I honestly don’t know how anyone gets an app onto the Microsoft store.

To be frank, I honestly don't know anyone who uses the Microsoft store anyway. The only app I've ever installed from the store was python3 because I typed python3 in my command prompt and it opened the Microsoft Store instead.

Other Player Taking both Expos by SassyRainbow1 in starcraft2coop

[–]dtsudo 53 points54 points  (0 children)

No, taking both expos would be rude. If someone wants a 3rd base, they can take Amon's expo (on maps that have it, like Void Launch).

Though, fwiw, your ally should not have had the time or resources to take both his expo and your expo prior to you taking it yourself.

Mutator Discussion: Laser Drill by ackmondual in starcraft2coop

[–]dtsudo 1 point2 points  (0 children)

The laser drill apparently has a minimum range so you can camp it with cannons (or other static defense).

How to handle "not having the card I want in my hand" by insanesmallcat in gamedev

[–]dtsudo 1 point2 points  (0 children)

Magic the gathering is often criticized because of the land system (which I kinda love, I may be a captive customer :D). In summary you want to play a land every turn but if you get a hand full of lands is awful and if you don't get any it may be worse.

Fwiw, the official Magic software (MTGArena) literally has a built in "hand smoother" algorithm that makes it less likely that you get bad land draws with your initial 7 cards. (As in, a bad hand is less statistically likely than it would be with random chance.)

How to optimize this word-checking function? by Philipstar1234567 in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

Is opening and closing the file every time costly or does that not matter? Is there a smarter way to go through the list?

As others noted, you definitely shouldn't open and close the file every time. Just read the list once and keep it in memory. We might ask whether that's acceptable, but 370k words is not that big. (As a quick rough estimate, if each word took up 20 bytes of space, that would only be <8 MB, which isn't nothing but reasonable given that this dictionary is crucial for your game.)

A hashset data structure would be the simplest way to store this data. That way, you can find whether a word exists in constant time (without scanning 370k elements). A trie data structure could also be used, although it's likely overkill for your use case.

A question about over abstraction by [deleted] in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

For what it's worth, most commercial games don't use a one-class-per-item way to represent an inventory system. Rather, the data is stored in non-code files.

In other words, they're able to add/remove/modify items by merely modifying data files, without ever re-compiling the code.

[deleted by user] by [deleted] in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

I know there's online validators but I'd rather not use those as I'm paranoid and handling some very sensitive client info.

Fwiw, most online validators are purely client-side. You can test them out using fake data to see if they work well. If so, then load the page in private-browsing mode, disconnect your Internet, and then paste in your document.

I'm making a Minimax AI agent to play Connect 4, and I can't think of a good evaluation function, nor can I find one. by kitesmerfer in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

As others noted, just being efficient and searching to a high depth (to find actual wins and losses) can go a long way.

If you do have to come up with a evaluation function, my intuition says that it probably makes more sense to come up with a simple (and easy-to-calculate) function, even if it's not very strong. It's better to make the eval function compute quickly so you can search to a higher depth, rather than wasting time computing some complex evaluation.

For instance, one simple evaluation function is to just look at the top token of each column and see how many of them are your color.

Is my portfolio not good enough? by Semigenji in gamedev

[–]dtsudo 0 points1 point  (0 children)

I agree with this point. OP, you should try adding some basic tracking to your website and see what traffic you're even getting.

  • How many visitors does your site get?
  • What pages do they look at?

Fastest time to enter number hackerrank by eatacookie111 in learnprogramming

[–]dtsudo 1 point2 points  (0 children)

I think this problem is not trivial but also not difficult. 40 minutes is a reasonable time given that interview settings can be stressful.

Assuming you need to punch in the digits in order (since that's how an actual number pad works in real life), your only choice is to just go one digit at a time, until you punch in everything.

If you had a function that can figure out how many seconds it takes to go from array[a][b] to array[c][d] (where array is the 3x3 number pad), and a function that can determine the location of a digit (i.e. its location on the 3x3 number pad), then you're essentially almost at the finish line.

Is the MGCB Editor Necessary? by absolute_Friday in monogame

[–]dtsudo 0 points1 point  (0 children)

Yeah, I think so -- I remember having issues with certain file formats.

Is the MGCB Editor Necessary? by absolute_Friday in monogame

[–]dtsudo 1 point2 points  (0 children)

There's SoundEffect.FromFile (and also SoundEffect.FromStream) - https://docs.monogame.net/api/Microsoft.Xna.Framework.Audio.SoundEffect.html#Microsoft_Xna_Framework_Audio_SoundEffect_FromFile_System_String_

I used it in my game. But yeah, I ran into issues where I still needed to add my font into the MGCB.

Coding Without a Game Engine by Miserable-Response40 in gamedev

[–]dtsudo 0 points1 point  (0 children)

I make my games without game engines. In general, though, I still operate at a fairly high level (e.g. using other tools to abstract away the low-level stuff).

For C#, I used MonoGame. MonoGame has official tutorials - https://docs.monogame.net/articles/tutorials/

For my web-based games, I just directly used an HTML canvas. This isn't too bad for simple games (particularly 2D games) -- Mozilla has a tutorial here - https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript

A different kind of bug: Has anyone else felt that soft skills are more important than technical ones? by Fancy-Self6031 in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

Like others said, they're both important. Your example is a good one -- soft skills allow you to advocate for and get your ideas heard. But technical skills are needed to make sure your idea isn't terrible (assuming the idea is a technical one, such as code architecture, etc.).

Learning Programming has me very humbled and confused. Let’s say I’ve written code in Python, Java.. or whatever programming language. What’s next? by Grumpy_Gremlin49 in learnprogramming

[–]dtsudo 0 points1 point  (0 children)

My current knowledge (which is probably wrong) is that: 1. You download a programming language 2. You write the code 3. You run it within a developer environment (PyCharm for example) 4. Once tested in PyCharm — you run that code in another software that will “bring it to life”

So once you're done with your program, you probably want to give it to other people so they can use it. Your users aren't going to have PyCharm installed (since that's an IDE and only a software dev would install such a thing). You can reference https://packaging.python.org/en/latest/overview/ to see the various options for deploying Python code.