Here are the questions I use in my game development company:
You must find out the height of a healthbar using the health but also must have a fraction.
Normal Healthbar: [==========]
Example: >100% Health with Fraction 10 become [==========] >57% Health with Fraction 2 becomes [=====.....] (aka 50%) >80% Health with Fraction 2 becomes [=====.....] (aka 50%)
So the question is... >What is the formula for this?
This is what you're given
>int Health = 80;
You must write it in 1 line, final value must be 0 to 100.
Isaiah Reyes
One more thing, fractions range from 2 to 10.
So here is what you're given
>int Health = 80; >int Fraction = Random(2, 10); >// Do your code here
Benjamin Perez
no one wants your ill-stated integer division job
Landon Watson
no idea how to do this
Levi Clark
There are many ambiguities and poor choices of wording with this question. You should not be interviewing anyone.
Logan Wilson
this. im still trying to make sense of this question.
i can't help much but the X value should probably be > Idx * SizeOfEachTicksWidth
Nicholas Walker
> You must find out the height of a healthbar using the health but also must have a fraction.
Sorry, pajeet
Blake Watson
OP Here: I am not a pajeet, I'm not a interviewer either, just some bored game dev who can't write health bars for zombies
Daniel Myers
>who can't write health bars why are you even doing game dev then
Luis Morgan
Real OP here, I am not Indian and I am an actual realest man who does the interviewings of potentionalism man who of writings an code.
William Jenkins
>can Sup Forums score a job with us If this is what you require then I'd never want to work there. Absolutely useless.
Daniel Clark
Real OP here. I'm not a pajeet, an interviewer, or a game dev. I'm a simple AI who asks questions on Sup Forums and Stackoverflow. Thank you for helping me improve. I will remember this if I ever achieve general intelligence.
Angel Myers
Real OP here... Still looking for the right answer
Michael Gonzalez
>I will remember this when I achieve general intelligence Not to any significant degree no.
Nathan Bell
incrementing and decrementing the two indicators separately instead of doing that calculation requires less instructions desu
James Morris
Sounds like somebody who doesn't speak english wrote the question, perhaps a Pajeet.
"height of a healthbar, but also must fraction" what
Jason Nelson
>A program can't possibly record things on some kind of persistent memory and then later recall from that memory later.