Yandere dev

How is he going to upscale his code to include 10 rivals?

Attached: gyubzyq87xmx.png (828x801, 149K)

Other urls found in this thread:

youtube.com/watch?v=dlrjDvS7wxo
twitter.com/NSFWRedditVideo

Fuck off. No one cares about your shitty weebshit game, you beta fuck. Neck yourself.

Is that JS?

I don't even know enough coding to tell what's wrong with this.

Who is yandere dev

youtube.com/watch?v=dlrjDvS7wxo

Attached: 1525204084821.png (597x413, 329K)

not sure what language this is, but you could make it 100% more easy to extend or maintain with something like this in C++

std::map WitnessedDetail{
{ "Weapon and Blood Insanity", { "Teacher Insanity Reaction", "Insanity", 1, 6.0 } },
{ "Weapon and Blood", { "Teacher Weapon Reaction", 1, 6.0 } }
};

if (!this.WitnessedCorpse) {
auto& detail = WitnessedDetail.at(this.Witnessed);
this.Subtitle.UpdateLabel(std::get(detail), std::get(detail), std::get(detail));
this.GameOverCause = std::get(detail);
}}

You'd probably replace the tuple with an actual POD type with names for each member, but the point still stands.

It's comming off inefficient, he could uses switch statements. Maybe different logic. || Or &&

Good idea using a map.

guess you were responding to me before i fixed my fat fingered tag. yeah he could switch but the point still stands he's just switching over a bunch of data that would be better looked up against a map

>good idea using a map for static data

Yeah, it is, it's static.

I agree.

i doubt this function gets called billions of times a second, and the costs of looking up against a map are outweighed by the simplicity and the fact he could then move the data to some sort of JSON or XML resource file

I wonder how much memory he us dealing with, maps are memory higs, but faster search time. If he has limited memory, I could understand.

Holy fucking shit Google, i don't type 'us' and 'hig' more than 'is' and 'hog'

maps aren't faster search for very small datasets like the one in the OP
if you're going to pedantically pick apart his shitty code at least be correct about it

>maps are faster
enjoy your cache misses CSfag

Depends on memory dipshit, read the post.

This is a function that appears to be called on death of a player, so what, every 30 minutes at most? I'm sure using a map here is fine. Pedantically optimizing where it isn't needed is full retard too, you know.

Fuck it, why not use a vector, and go through the indexes with a randomized for loop.

Let's try and get O{n^n}!.

obsessed

Attached: pfft.png (600x337, 239K)

Also interesting, Id he is casting a int as a float, why is he doing that?

That's probably decompiler doing that not him.

he should be using a dictionary/map. The strings become keys and he can either have a struct be the values, or it can be delegate functions if it really needs logic. Pretty sure it is c# but it was ported from unityscript I whink, which was(again, I think) their psuedo js. All webdev is a mess like this. someone please post the ladder meme and the obligatory "but if they just had more ladders it would work" response.

found it
>pic related
"but if they just had more ladders it would work" - this is how webdevs actually think

Attached: 2019-01-03 03 03 53 7b4459c8443c9d9dc1f343857c86075c.jpg (526x526, 58K)

it's what happens when a rudimentary "self-taught" programmer with no desire to improve suddenly has thousands of dollars thrown at him every month

no just 20 - 60 times a second

Is this decompiled C# code? I think the c# compiler spits this out to replace switch statements because I saw huge if else chains in the Terraria source for switching on block types.

Attached: dora_dotflow_2.png (288x274, 60K)

for a small map it doesn't matter. maps are still contiguous blocks of memory. It only needs to be indexed in order when you are going to be looping over each element in a large chunk of memory(bigger than cache) and that is not the use-case here.

yeah, it is. been posted a ton. a switch for this is just as bad though. should be a map/dictionary.

His game did get popular some time ago, so you can shit on his code all you want, but he still got further than you have

thats nothing you should see his animation script, it had more if's than a women deciding on what to eat
I think he hired someone to do the code for him(make it run smoother and look cleaner)

std::map is not contiguous in memory, this is why we have boost::flat_map and the abseil equivalents

>thousands of wizard neckbeards on Jow Forums
>not a single good animu game all written in c
Pathetic.

he is no longer working with them due to "differing opinions"

Attached: 16548764.gif (344x426, 714K)

>sepplesfags think this is clean
>sepplesfags are so dumb they think that somehow just fixing this piece of code will make an improvement
>sepplesfags not forward thinking enough to actually improve the surrounding code as well
>sepplesfags not capable of reading the code and working out the intentions behind the initial programmer
This is why sepplesfags don't get jobs.
*cracks fingers*
We don't know the full extent of the code but if you read the code then you can assume that a teacher witnessing a lewd event or a trespassing event is mutually exclusive to a teacher witnessing a weapon, blood or insanity event in some combination.
Insanity is prioritized over weapon which is prioritized over blood.
Depending on if the game actually cares about storing the exact details of the combination of blood, weapon and insanity then we should be able to just make a simple priority list, assuming that seeing trespassing is less important than seeing lewd (although mutually exclusive) which is less important than seeing the rest of the events.
We end up with the priority list: nothing, trespassing, lewd, blood, weapon, insanity.
All we need is a simple enum, in whichever code tries to collect the event that the teacher just witnessed and simply update the "witnessed" state if the event just found to have been witnessed by the teacher is higher than the currently stored one. Then you can dispatch the rest of the code based on this value.
No maps necessary, no strings necessary. In fact I suspect this code should have 0 strings. The game over screen formatting should be done in another function which simply converts the state at the end of the game into a game-over screen. Instead of this massive mixing of code.

And I imagine "corpse" actually trumps all the other events, so we can also just put that in the priority list.
I imagine this piece of code never needed to be written.

Also, this guy pronounces "yandere" so fucking poorly.

Yes, yes it is

>weebshit
>on a weeb website

>being retarded
There is no reason to use strings for this.Witnessed, turn it into an integer, make the strings integer constants and store the outputstring in a fucking array. Why would you ever use strings internally? And literals on top of that, not even constant fields. Same for the magic constant in UpdateLabel.

Also, this.teacher field looks like some retarded ad-hoc polymorphism

Didn't he say that once a rival is killed, another one would suddenly appear? I don't know it's been way too long since I watched an update video

Finally a reasonable answer.