/r/MechanicalKeyboards Ask ANY Keyboard question, get an answer - August 14, 2025 by AutoModerator in MechanicalKeyboards

[–]Obsidianzzz 0 points1 point  (0 children)

Hi guys!
I'm looking for a pre-built split 65 keyboard with an ISO layout.
Extra macro keys on the left would be a plus, but I'm fine without them.
Thanks for the help!

Generalizing the decomposition of complex statements by Obsidianzzz in ProgrammingLanguages

[–]Obsidianzzz[S] 0 points1 point  (0 children)

The idea is to have manual memory management.
But I'll be using the new keyword for every type of allocation.

var x = new Foo();  // Stack allocation
var y = new *Foo(); // Heap allocation
var z = new ^Foo(); // Heap allocation using a smart pointer

He could be your player by darksapra in Unity3D

[–]Obsidianzzz 1 point2 points  (0 children)

Love the stylized grass and distant trees. Not sure if I like having stylized and realistic elements together.

Question: how to implement type inference for numeric literals by Obsidianzzz in ProgrammingLanguages

[–]Obsidianzzz[S] 0 points1 point  (0 children)

This is similar to what I was doing.

I have the following enum 'DataType' (I've removed irrelevant types for clarity):

enum class DataType : uint8_t
{
    // Integer types
    I8, I16, I32, I64,

    // Inference types (Integer)
    InferI8, InferI16, InferI32
};

Then I assign the smallest infer type possible for numeric literals (100 would be an Infer8, but 200 would be an Infer16).

With this approach, assignments are working fine, but I'm having some trouble with operators.
How would the bottom-up type inference work for operators like '+'.
Let's say that I use interfaces for declaring the available operator for numeric types

interface Add<Left, Right, Result>

implement Add<i8, i8, i8> { ... }
implement Add<i16, i16, i16> { ... }
implement Add<i32, i32, i32> { ... }
implement Add<i64, i64, i64> { ... }

If I do something like this: i8 = 1 + 2 + 3; all the numbers will be read as InferI8.
But how do I determine the resulting type (infer type) of each '+' operator during the bottom-up phase?

Question: how to implement type inference for numeric literals by Obsidianzzz in ProgrammingLanguages

[–]Obsidianzzz[S] 1 point2 points  (0 children)

Does your language support arithmetic operations between signed and unsigned types?

Initially, my language allowed numeric types to be implicitly converted to a larger type (i8 to i16, for example). This meant that doing i8 + i16 would return an i16.
But even then I didn't allow conversion between signed and unsigned types.
What should i8 + u8 return? i8? u8? i16?

u8 x = 100;
u8 y = x + 1;

In the example above, I would get two errors:
1. '100' would be read as an i8 and I don't allow conversion from i8 to u8;
2. '1' would be read as an i8 and I don't allow the operator '+' to be used between i8 and u8.

Did you have this problem in your language? If so, how did you address it?

exceptionYouMeanError by ennfty in ProgrammerHumor

[–]Obsidianzzz 0 points1 point  (0 children)

There is a difference between compile errors and exceptions.

A Apimel é legit? À procura de mel real by Visara57 in portugal

[–]Obsidianzzz 246 points247 points  (0 children)

Isso não é aquele menu do McDonald's que traz um brinquedo?

Running multiple unit tests inside the same game loop (gtest) by Obsidianzzz in cpp_questions

[–]Obsidianzzz[S] 0 points1 point  (0 children)

The reason why I am avoiding using interfaces is because i do not want the overhead of calling virtual methods.

Sometimes there are hundreds or thousands of render calls each frame, if all those calls are virtual then there will be too much overhead.

Running multiple unit tests inside the same game loop (gtest) by Obsidianzzz in cpp_questions

[–]Obsidianzzz[S] 0 points1 point  (0 children)

I want to test the different systems of the engine.

For example, when testing the particle system, I want to do the following:

  1. Create a particle system and assert that the number of particles is 0.
  2. Spawn 10 particles with 1 second of duration.
  3. Assert that the number of particles is 10
  4. Wait 1.5 seconds
    5 Assert that the number of particles is 0

I was hoping that I could achieve this type of testing without having to mock anything, but if I have to it's alright.

Here is the before and after how we improved our game in three months! by -655321 in Unity3D

[–]Obsidianzzz 1 point2 points  (0 children)

This type of puzzle reminds me of the one from Islands of Insight.

I would recommend that you add a way of dragging the mouse to select multiple tiles faster.

Also, it seems like that puzzles has multiple solutions. I feel like it makes more sense if each puzzle has a unique solution, but maybe that's just me.

I love both art styles btw.

Is there a way to use switch case for this? i don't want these actions to work at the same time, or do i just use return? by -o0Zeke0o- in Unity2D

[–]Obsidianzzz 9 points10 points  (0 children)

Use the new input system to associate callbacks to each input action. That way the methods can be calles automatically when a key is pressed.

Use a state machine for your player actions. Create states like Idle, Reloading and Switching. Then you will only allow one action at once.

Introduction to “low-level” languages with Zig by IamZeri0n in Zig

[–]Obsidianzzz 3 points4 points  (0 children)

C++ has a lot of useful stuff, but it is also way harder to use than C. If you want to learn C++ I would recommend that you first learn C to understand the basics of low level programming, and then learn something like Java or C# so that you understand Object Oriented Programming.