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

help-circle










  • This looks like a C macro. Basically what it does is replaces the word “true” in the code with (rand() > 10). The rand() function will return a random number from 0 to 32767. So (rand() > 10) will very likely return “true” but not always.

    So say you have some code like this: if (someVar == true) { // Do stuff } It would replace “true” with code that usually evaluates to “true” but not always. So every so often your code would just do the wrong thing but it would be hard to debug because it would be rare.

    Granted, in that example you probably would just write “if (someVar)” making this moot, but there are more realistic cases where you’d use the constant “true”









  • I hear people say “program in assembler” but IMO that’s wrong. I’d say you write the code in “assembly language” (or better yet, the actual architecture you’re using like “x86 assembly”) but you “assemble” it with an “assembler”. Kind of like how you could write a program in the “C language” and “compile” it with a “compiler”