lainchan / r

(untitled)

<Zero> · 2018-04-20 05:53
I don't know what this does if anything at all. ``` C void Anarcho.taco.society (int taco,int anarchy, int sandwich){ taco=0; anarchy=0; sandwich=0; if(taco < sandwich || taco == sandwich) { anarchy++; taco++; printf("%d",anarchy); } int main(){ int A=9999; A=anarcho.taco.society (%d,%d,%d,A,A,A); return 0;} } ```
<Zero> · 2018-04-20 05:53
also, I have no idea how to set up the code option on here.
The Plague · 2018-04-20 08:04
What language is that? If it is C, dots are illegal in function names, and function implementations inside other functions implementations is illegal too.
Dozer · 2018-04-20 10:53
Not to mention that anarcho and Anarcho are different things, or that you are giving 6 parameters to a function that accepts three, and 3 of those are illegal because it literally says "the void chaos undead matron of stallman modulo d". Also A= doesn't make sense as anarchotaco... is a void function. Okay wow, so you have main inside anarchotaco, and from main, you (want to) call anarchotaco with some values that you null right away. It's clear as day that whoever wrote this code has no idea how any of the elements in it work. They don't know what functions or scopes are, and they even tried to imitate printf when trying to pass arguments for a function. This is what happens when someone sits down, stares at a few lines of example code for a day or two, and then tries to create more by imitating it. This is why you shouldn't believe advice like "reading code is the best way to learn". It is when you already know several languages, and have an understanding of how programming languages work on an abstract level; at that point you only need to learn the little surface details and choices about a language, and that is indeed easier from code. But this is details, lexical knowledge, not understanding. You need someone to explain that, be it a person, or a well written book or series of lectures. Now, if I take a look at your OP pic, the name choice of <Zero>, the choice of variable names in this code, and the style in which you put the question, I have a gut feeling that you're one of those kids in school who always seem to be "working" on some "cool project", but it's mostly about the aesthetics and coercing others into keeping you company. I don't want to discourage you, but rest assured that you have no fuarrrking clue of what you're doing, and you won't have if you just follow a trial-and-error, learn-to-code approach, or if you fall for the meme of learning programming languages instead of programming. These are not natural languages, you don't learn them by copying papa and mama. They are formal languages constructed by people, with intentions. You don't need to be an expert on formal languages but both a solid understanding of what is allowed and what the intended use of things are is required. You can't learn that by reading code + trial and error, ever.
/r/mod · 2018-04-20 18:27
Lurk before posting, try to create threads on their respective boards. This topic is more suited for >>>/λ/. However since it doesn't meet the criteria for said board this thread will be locked. Perhaps you should post this question in the beginner's general thread. >>>/λ/5824