Old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
>very few comments in the winapi headers
>it's shit like this
I just finished writing a fizzbuzz program in pure machine code using only a hex editor.
I just finished in your mom LOL
I want to quickly evaluate if it has a shit api or not quickly so I just write some pretend user-code that does what I want and then try to fit it to the library. If it doesn't fit with reasonably little effort it's a shit library. At least the API side of it. Most of the time that's enough to deter me.
Of course there's libraries I'm forced to work with and then it turns into a question of if I wrap it or if i just deal with the horrible API for others convenience.
Go to MSDN.
when you are told to comment your code so you point out the obivious
anime is trash for pedos
What machine?
>Go to MSDN.
Wasn't complaining for the lack of documentation, I'm just rewriting the headers. Just pointing out the silliness
>2017
>not being a pedo
get some tastes bro
I am working on a multiplayer blackjack game using bitcoins
Ok.
You get over it.
Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
You want to feel better? The first step is to man up and stop making everything about how bad you feel.
>Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
>You want to feel better? The first step is to man up and stop making everything about how bad you feel.
its so easy to spot those with aspergers / alexythmia
>have you tried not being unhappy?
what a flaming homo
It's true though, it's impossible to be depressed if you have the discipline to simply will your thoughts not to constantly revolve around how depressed you are.
So all those doctors and medicine are just a massive conspiracy to siphon money from narcissists?
post code faggots
In my country, when "massive conspiracies to siphon money" are actually helpful, but can still be considered conspiracies because they're not actually necessary, we call them "luxuries."
>Depression is literally just narcissism. They're both pathological self obsession and cause exactly the same kind of psychological agony, the only difference is your fixation is negative.
I used to think this way until I realized depressed people sometimes kill themselves. A narcissist would never do that.
>it's impossible to be depressed if you [...] will your thoughts not to revolve around how depressed you are
>it's impossible to be depressed if you aren't showing the symptoms of depression
What a shocking conclusion!
anizb user, is your site dead for good? i miss it already
most depressed people try to escape from the thought of their depression with distractions and yet still hurt, im starting to think you just dont understand how people work
This.
Basically user here thinks she has been depressed and she just had the discipline to get out of a moody situation.
>most depressed people try to escape from the thought of their depression with distractions and yet still hurt
That's because they lack the willpower to keep their thoughts away from how self-obsessed they are.
>inb4 that's what depression is
It's not. Lack of willpower is not an illness, it's a personal weakness and a good reason to do the rest of humanity the courtesy of removing yourself from the gene pool.
Why exactly are you looking through winapi?
const int or enum?
>That's because they lack the willpower to keep their thoughts away from how self-obsessed they are.
yeah, you obviously have lacking mind theory, a common symptom of autism. hope you get better soon buddy
Actually I still am depressed.
The other messages were my mental depression demon taking the wheel.
You know how sometimes when you have a mental illness you get the little voice that's like "yoooooou suuuuuuuuuck blegh blegh blegh bleh heh heh blorch"
>Actually I still am depressed.
So you haven't even cured yourself?
Just shut up.
>little voice
Most depressed people don't describe having MPD/schitzo issues. Stop pretending you're depressed.
see
Oh, I see.
if a enum could serve you why use const int?
attacking depressed people doesnt work well in hiding how miserable you are yourself my man
because when making wrappers to C libraries most languages have fucking retarded way of declaring enums but you can pretty easily use variables and especially ints.
>So you haven't even cured yourself?
Of course I haven't. How could I with an attitude like this? I'm also this guy: >Most depressed people don't describe having MPD/schitzo issues. Stop pretending you're depressed.
But muh psychiatrist
Why do people say you should never goto inside a block? Used judiciously, it can make you repeat code less.
int main(unsigned argc, const char* const argv) {
unsigned i = 1;
if( argc == 1 )
goto once;
for( ; i < argc ; i++ ) {
if( freopen(argv[i], "r", stdin) == NULL )
error("Could not open %s", argv[i]);
once: /* loop will stop at next iteration, since argc = 1 and so is i */
parse();
}
return 0;
}
what a pile of garbage
theres break and continue for that
dumb java poster.
Should enums be named as plurals or singulars?
i.e. enum FooFlag{}; FooFlag flag; or enum FooFlags{}; FooFlags flag;
Well, for one thing, because then you have to do this shit:
>/* loop will stop at next iteration, since argc = 1 and so is i */
>java
not him but I use breaks and continues in C and don't even use Java so I have no idea what you're talking about
dumb high level language poster
learn assembly then see why goto is bad my noob
post your programming environment
you need goto's in assembly because there's no loops...
>he needs more than (, ), and # for syntax
>Of course I haven't.
Then why are you giving advice counter to the professional advice you've been given?
I'm not hiding that. I have been diagnosed MDD.
think about it in the context of C code my little brainlet.
>his language doesn't define compilation for 3D text arrays
Animefags need to stop.
...
>his language's syntax is more than spaces
nobody would program whole project in C, it's only used to make common codebase that you can use any language on.
You actually don't need goto in assembly.
You can just always use call.
If you need a loop, you can do it recursively.
For TCO, you can pop the stack before the call.
pic related
kek
>Then why are you giving advice counter to the professional advice you've been given?
I am the guy I was giving advice to. I was samefagging.
>dude just like use recursion in assembly bro!
you have never done recursion in assembly and I doubt that you have ever written any assembly language.
>I was samefagging.
This doesn't change anything.
see picture
I like the p convetion for predicates in CL, but sometimes, you need to add a dash, otherwise it will look akward, this is why I like ? for predicates also.
old pic
???
What are 3d-text arrays?
go away, esoteric fag
...
When the bad voice says stupid things, they have to come out, because if they stay in, I become a lump.
The fact that they're stupid is irrelevant to this.
>tranny
>and I doubt that you have ever written any assembly language.
You're right I've never invented a unique processor architecture so very sorry
>Lisp fags think their language is minimal
you're saying like that's a bad thing
I want to get back to Javascript. I did the codecademy course eons ago and did some personal dicking around but never dived as deep as I wanted to.
Book recommendations, anything?
...
its bad and you must be punished for being such a degenerate faggot user
there is nothing gay about a feminine penis
mozilla javascript guide + es6 features page
It is minimal if you hand-roll a mechanical compiler that plugs in as a USB device and compiles to a breadboard instead of to a program on the disk.
it'll be gay when i pull your panties apart and rape your pucci
oh pls """"punish"""" me for being trans sempai
>Just another way JS pretends there are primitives.
They look like primitives, act like primitives and are identified in the spec as primitives as opposed to objects.
How are they not primitives?
It's not, its kitchen sing for me.
>lisp fags don't even have empty lists
>(atom nil) => t
lmao
who cares
it's shit
i'll make you choke till you pass out.
Debunked.
atom is everything but list with values.
There is empty list '() which is equal to nil
>What are 3d-text arrays?
Imagine a page of normal text. It's 2D, every character has an X and a Y position and every character can be determined to be left/right and above/below another arbitrary character.
Languages like C are 1D, they don't consider whitespace important in most cases and newlines can be omitted completely excluding the preprocessor.
Python is 2D, it has whitespace play a significant role through indentation.
A 3D language would have you define statements in 3D space. Allowing you to fit more of your code on your screen (which is a 3D->2D projection).
But if you have a 2D or 1D language and try to do this it's rather pointless.
And naturally you can store n dimensional text as a flat array, this is now about the storage.
By having methods and constructors. And I really don't care if JS is that retarded to leak out implementation details in the typeof operator, which is just one way it is broken and one of JS broken operators.
>(consp nil) => nil
>leak out implementation details
There's literally nothing wrong with this
I don't even like javascript
The original claim was:
>lisp fags don't even have empty lists
Not:
>lisp fags don't even have empty pairs
list aren't real in lisp, they're an illusion
just cause you have a function like so
(defun listp (x)
(or (consp x)
(eq x nil)))
doesn't mean the empty list exists
there is no such thing as an empty list
Wrong. Types in Lisp and similar languages are just predicates. The function listp is a type. A datum x is a list if and only if (listp x) => T. And that's not an invariant to which listp must adhere, that's the actual definition of a list (that is, the "is-a" relationship goes the other way).
That's just syntactic sugar.
>There's literally nothing wrong with this
There is, and it's the reason nim is crap, PHP is crippled, git is semi-functional garbage and the old UNIX folks should have done the way of Uriel and debugged themselves before creating their OS.
If I wanted to program in a scripting language in which I must know the implementation I'd program the interpreter myself.
If you don't want to have to know the implementation just don't use the leaked implementation details
>By having constructors.
We established that the constructor Boolean returns a different value than a boolean literal. Not only does it work differently with the typeof operator but it works differently as a conditional (new Boolean(false) weakly equals true)
Can you find any source that states that Javascript doesn't have primitives? Because I've shown you the spec itself, and the spec says that it has primitives which aren't objects.
>Not only does it work differently with the typeof operator but it works differently as a conditional (new Boolean(false) weakly equals true)
Wow that's horrible.
Prove it to me?
Can hardly believe it.
That doesn't mean an empty list is real.
That's just a construct which is useful for things such as method overloading.
I'm working on an automated testing framework. It's java based.
> Hello I'm pajeet
var prim = false;
var obj = new Boolean(false);
if (prim) {
alert('primitive false is true');
} else {
alert('primitive false is false');
}
if (obj) {
alert('boxed false is true');
} else {
alert('boxed false is false');
}
alert('typeof prim: ' + typeof prim);
alert('typeof obj: ' + typeof obj);
How do I do slope collision in a 2D platform game with tiles?
How I understand it, is that I need to define the type of tile, so that if tile whatever is equal to 1, its a solid square, 2 is an ascending slope at 45 degrees, 3 is a descending slope at 45 degrees, etc.
My problem is is that I have been unable to come up with a good formula for moving alongside the slope.
I calculate which tiles to check, only those around the entity.
for ( cy=top_t; cy
>That doesn't mean an empty list is real.
Yes it does. An empty list is real as in really a list. Because a list is just any datum for which listp returns true, and listp returns true for the empty list. There is no "really a list" beyond whether or not listp returns true. There's "really a pair," which is decided by whether or not consp returns true. But there's no rule stating that all lists are pairs.