that breaks numbers like 8.3 tho
Let me check.
Right.
In storyâs silly ahh goofball world of her own doing, collision detection. and like it probably isnt the best way for that either but I discovered theres absolutely nothing on this and now im just fascinated
you have the goober
she is currently fully in tile 10 or tile 3:2 of this image. tile 10 is blank. it doesnt do anything on interaction. all good. 3 rounds to 3 and 2 rounds to 2. a dummy function is called
but lets say you have a normal situation, where say, gravity is being applied. she goes down. just a teency bit.
she is now in 3.1:2. The tile being touched is 4:2. the previous tile that she is in more of doesnât matter as the gravity of the game means she will never reach a tile faster than it can be detected.
Okay, now the goober moves left. On this tick, after gravity, she is at 3.1:1.9. the two functions that need called are 4:2 and 3:1
On any given tick only 2 tiles need to be interacted with, being near round x, far round y, and far round x, near round y.
is this overly complex?? yes! yes it is! i do not need to do this! there is no harm in using conditionals or my slightly clunky solution or taking an actual course on games development instead of just winging it like a boss! however. i think this is neat
I also think itâs neat.
Yeah, I think the solution is probably just to figure out the top number and subtract from that.
So like:
public int roundWrong(double number) {
int upValue = ((int) number) + 1;
return upValue - ((int) (number + 0.5));
}
The annoying part is that this is a piecewise function, so youâre not going to get any neat solution minus potentially some sin/cos wave shenangians?
my need to unneccesarily optimise random things will persist forever. I was born in the wrong generation man. Take me back to programming restraints and people making software on their own
meanwhile me writing python code and going âit works nya nya nya it doesnât need to be fast it never runs with large inputsâ
except for combinatorics mafia
i will have to add more optimizations and put it in C :pensive_cat:
one time I was working with txt files as storage because my cloud hosting thing didnt allow hard storage or databases without paying money (evil) (also I was stupid at this time but thats unrelated) and the best most memory efficient way to select a random line from the file was in python and I had to port it over to go
This resonates with me on a personal level.
- it is rounding after all. what does 8.5 do however? uhhh lets say 8.5 does not matter and I do not care
8.5 goes to 8, I think.
one time i was working with .csv files as storage because i was dumb and didnât realize i should just use jsons (this is in terminal of lies and now itâs painful to change so it will just be there)
so like what is combinatorics mafia if you ahve to optimise it and put it in C im intrigued
8.5 rounding up for closest is just as weird as rounding down. I dont think its very important
actual life goal
COMBINATORICS MAFIA!!! itâs the setup May is hosting soon
i would like to find a strategy that optimizes the worst case number of guesses*, and how many guesses this strategy requires
*Iâm imagining it as a singleplayer game where itâs just town guessing mafia, rather than two sides actually competing, as itâs way simpler that way