[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Can /g/ score a job with us?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 44
Thread images: 5

File: 1784.jpg.png (330KB, 640x448px) Image search: [Google]
1784.jpg.png
330KB, 640x448px
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.
>>
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
>>
no one wants your ill-stated integer division job
>>
no idea how to do this
>>
>>59696138
There are many ambiguities and poor choices of wording with this question. You should not be interviewing anyone.
>>
>>59696409
this. im still trying to make sense of this question.
>>
value/maxvalue * lengthofbar
30seconds/60seconds * 400px
>>
with integer arithmetic: (health/(maxhealth/fraction))*(maxhealth/fraction)
>>
>>59696417
No... it must convert the Health into a fraction... like pretend there is Ticks, 5 ticks for a fraction of 5.
>>
>>59696513
winrar
>>
>>59696513
Congrats! That's the right answer!

Now how would you draw all the ticks??

Lets say the width right now is 25, how would you know where to draw the ticks?

Here is normal health bar:

>DrawRectangle(0, 0, 25, 10, ColorHealthbar);

You can use a loop for this, just make sure it draws the correct number of ticks (which is Fraction)
>int Fraction = Random(2, 10);
>>
>>59696613
what are the first 2 arguments of that method? coordinates?
>>
File: you cant bait me.png (73KB, 618x618px) Image search: [Google]
you cant bait me.png
73KB, 618x618px
>>59696138
>>59696163
>>59696613
Nice thinly veiled "H-hey /g/ I'm having trouble with my CS homework" thread, fuck off.
>>
useless complicated representation model.
if you really use such logic for your "games" then please consider suicide via large insertion
>>
>>59696669
If you don't know what the four parameters for drawing a rectangle are then you don't belong on /g/ and should kill yourself immediately.
>>
>>59696669
most likely following the retarded mindset health/maxhealth
>>
>>59696669
These are them:

>X, Y, W, H, Color

but you will use X and W for this question as you are drawing Fraction amount of ticks.

Ticks will be using a H of 1, so there would be 5 DrawRectangle calls for a Fraction of 5
>>
>>59696709
>asking for specifications of a random function is wrong
I hope you don't work in STEM
>>
>>59696743
so you want it like this?

>int Health = 80;
>int Fraction = 7;
>int FixedHealth = (Health / (100 / Fraction))*(100 / Fraction);
>DrawRectangle(0, 0, 25, 10, Black); //Draw the background of healthbar
>DrawRectangle(?????????, 0, ??????????, 10, ColorHealthbar); //Draw the healthbar
>for (int Idx = 0; Idx <= Fraction; ++Idx)
>{
> DrawRectangle(Idx + ?????????, 0, ??????????, 10, ColorBlack); //Draw each tick
>}
>>
>>59696821
No, a tick would be a width of 1 and height of 10.
>>
>>59696840


>int Health = 80;
>int Fraction = 7;
>int FixedHealth = (Health / (100 / Fraction))*(100 / Fraction);
>DrawRectangle(0, 0, 25, 10, Black); //Draw the background of healthbar
>DrawRectangle(?????????, 0, ??????????, 10, ColorHealthbar); //Draw the healthbar
>for (int Idx = 0; Idx <= Fraction; ++Idx)
>{
> DrawRectangle(Idx + ?????????, 0, 1 10, ColorBlack); //Draw each tick
>}


like this then
>>
>>59696868
i can't help much but the X value should probably be
> Idx * SizeOfEachTicksWidth
>>
File: you-have-to-go-back.gif (348KB, 350x233px) Image search: [Google]
you-have-to-go-back.gif
348KB, 350x233px
> You must find out the height of a healthbar using the health but also must have a fraction.

Sorry, pajeet
>>
>>59696953
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
>>
>>59696977
>who can't write health bars
why are you even doing game dev then
>>
File: 1440064310Intelligence.jpg (2MB, 3000x2250px) Image search: [Google]
1440064310Intelligence.jpg
2MB, 3000x2250px
>>59696977
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.
>>
>can /g/ score a job with us
If this is what you require then I'd never want to work there.
Absolutely useless.
>>
Real OP here. I'm not a pajeet, an interviewer, or a game dev. I'm a simple AI who asks questions on 4chan and Stackoverflow. Thank you for helping me improve. I will remember this if I ever achieve general intelligence.
>>
Real OP here... Still looking for the right answer
>>
>>59697201
>I will remember this when I achieve general intelligence
Not to any significant degree no.
>>
incrementing and decrementing the two indicators separately instead of doing that calculation requires less instructions desu
>>
>>59696414
Sounds like somebody who doesn't speak english wrote the question, perhaps a Pajeet.

"height of a healthbar, but also must fraction"
what
>>
>>59697329
>A program can't possibly record things on some kind of persistent memory and then later recall from that memory later.
>>
File: Desert.jpg (826KB, 1024x768px) Image search: [Google]
Desert.jpg
826KB, 1024x768px
wefksd kwejd dfjdflghtglj;er l;jdsfzs l;hj lhj;hlerjw;dfogub kjlbx lkd klefhjlkh 4oui 8huxkjhv li 3iul fluhdxfkl lktjwefsf ??? :D
>>
>>59696138
Can someone please explain to me exactly what this nigger is saying?
>>
>>59696764
>DrawRectangle
>random function

You should literally kill yourself and your entire family immediately, you fucking retard.
>>
quit doing OP's homework you faggots
>>
>>59696138
> height
height is vertical you fucking idiot

Also fuck you for not making the health bar correlate directly with the health
>>
>>59696414
If you don't even know what you want to ask, how can you expect someone else to answer it?
>>
>>59696138
Sorry, I didn't go through years of school and years of being employed as a developer to make text-based games. Enjoy your BBS Door games or whatever.
>>
>>59696138
Health bars are cliché and entirely played out. I'd tell you to develop a new mechanic or enjoy being a meme company churning out garbage terraria clones, SJWretro faggot/Todd Howard.
>>
>>59698134
This
Make the character pant when he's mildly hurt and wheeze when moderately hurt and moan when badly hurt.
>>
What the hell is this idiocy
>>
>>59698321
this but also make the character a lewd anime girl
Thread posts: 44
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.