[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]

How smart is /g/

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: 66
Thread images: 6

File: BlackIsleStudios.png (10KB, 1182x651px) Image search: [Google]
BlackIsleStudios.png
10KB, 1182x651px
Can you pass the interview question we give out in our game dev company?

>write it in C++ if you can
>>
>>59863070
are the squares width/height gettable?
>>
>>59863112
Try actually reading all the text on that image.
>>
>>59863070
>do my homework for me

my friend, if you actually want to do something with this, you need to be able to figure this out for yourself.

this shit is trivial.

>if its so easy why didnt you do it
>>
>>59863112
nevermind im retarded

redsquare.worldPos.y = greensquare.worldPos.y + redsquare.height + bufferzone
would probably need a few tweaks depending on the squares' origin point and the coordinate handedness but that should cover most of it
>>
>>59863070
>square
>>
>>59863164
theyre called squares in the OP
>>
>>59863187
meant for >>59863175
>>
>>59863175
>>59863187
And there's nothing to contradict this. You may have already finished your SATs but
>pictures are never to scale unless indicated
>>
File: qtqt.jpg (44KB, 825x960px) Image search: [Google]
qtqt.jpg
44KB, 825x960px
>>59863175
ill rect ur butthole faget
>>
>>59863070
No calculations needed, place red in top left and green in bottom right. It's the furthest away they can be.
>>
>>59863205
The squares have a sidth and a height you can get - why would they need both if they're squares?
>>
>>59863070
Is this supposed to be difĂ­cil?
>>
>>59863070
so wait, you just want me to redraw them in different positions?
>>
>>59863227
Squares innately have a width and a height. They just happen to be the same. There's nothing saying that they're gotten from different variables.

You're still reading assumptions into it. In fairness to you, though, that's the point of trick questions.
>>
looks like your website is down, friend.
>>
>>59863070
If that's the interview question I'd never want to work with you
>>
>>59863070
set red's dimensions to 0
set green's dimensions to 0
solved
>>
red.y += (green.x + red.y) / 2 + epsilon


Easy.
>>
>>59863380
Close, but why use X? X is the Left-Right coordinate.
>>
non-meme answer: y1 - ((h1 - (y2 - y1)))
>>
>>59863420
No it's not.
>>
>>59863459
Actually yes it is.

X is LeftRight
Y is TopBottom
W is Width
H is Height
>>
>>59863434
Y1 is red square and Y2 is green?
>>
>>59863494
yes
>>
>>59863070
Nope I wont pass.

But I'm a mechanical engineer and not a programmer.
>>
>>59863434
I don't think this is right, OP said you must get delta and subtract the red square from it so it doesnt overlap green.

That means you have to use the height of both squares.
>>
>>59863070
nice and complete question OP, I am sure many of us will participate in this quality thread
>>
>>59863586
delta is the height of the 3rd square formed by them overlapping
>>
>>59863070
I see no square.
>>
>>59863070
red.y = green.y - (red.height + epsilon)

This is a really shitty question.
>>
>>59863741
You must calculate the delta that includes both Red and Green's height.
>>
>>59863680
then do it lol

X is LeftRight
Y is TopBottom
W is Width
H is Height

You must calculate delta which takes in the Height of both red and green
>>
>>59863972
Why ? That's not even part of the question.
>>
File: online_2.gif (1KB, 17x14px) Image search: [Google]
online_2.gif
1KB, 17x14px
>>59863986
so... basically the delta is the height of the 3rd square formed by them overlapping?

fuck it im out, so fucking confuising FUCK
>>
File: troll-face-png-1.png (94KB, 900x900px) Image search: [Google]
troll-face-png-1.png
94KB, 900x900px
OP Here: i am starting to doubt /g/'s abilities, please dont let me down guys.

How can you guys be geniuses? /g/ Means genuis u knwo.
>>
File: troll-face-png-1.jpg (11KB, 400x400px) Image search: [Google]
troll-face-png-1.jpg
11KB, 400x400px
>>59864061
I'm working for Valve and I can't do it.
>>
Is this what you guys really do? This seems confusing as fuck, I've been doing C++ for years and cant figure it out, do i suicide
>>
Assuming the upper left corner is (0,0) and X and Y are respectively rows and columns.

Just positionning the red rectangle so that it's above the green one, without overlapping :
red.y = green.y - (red.height + epsilon)

If the problem is computing the minimum translation deltaY for red so that it's not overlapping with green anymore :
delta = (red.height - (green.y - red.y)) + epsilon

Let say epsilon = 0 if touching borders are ok.

P.S. : still a very badly exposed problem.
>>
here is mine: sorry

>NewRedY = RedY - GreenHeight
>>
you can stop samefagging now you braindead cunt
>>
>>59864236
OP Here: Why do you use epsilon and not touch the height of green?
>>
>>59864236
>epsilon

> #define MATH_EPSILON 1.175494351e-38F


sorry is this it!?
>>
>>59864263
Oh, I'm assuming the position of rectangle is upper left corner (like in Cairo for instance, and almost every graphic lib). So green height is useless. Espilon is meant to add a gap between the rectangles, if the solution requires the rectangles to not touch each others.
>>
>>59864320
OP Here: I see, so why not just 1.f or something?
>>
>>59864102
Is it hard being a janitor there?
>>
>>59864336
Because it's a variable, so that you can choose the size of the gap. You can even make it as big as yo mama.
>>
>>59864365
lol not a janitor., im the guy who sits infront of the office with the secretary
>>
>>59864379
OP Here: so if its a variable how come some guy
>>59864316
found this?
>>
>>59864400
I guess that's a coincidence. My epsilon is totally not 1.175494351e-38F. Actually, it could be, but it's more than that. My epsilon is better. My epsilon is the whole real. My epsilon is infinite.
>>
>>59864509
so can you share with us this epsilon
>>
>>59864556
Look in you heart son, you'll find it.
>>
File: file.png (316KB, 397x579px) Image search: [Google]
file.png
316KB, 397x579px
>>59863070
div {
display: block;
position: static;
height: 20px;
width: 50px;
}
.red {
border: 1px solid red;
}
.green {
border: 1px solid green;
}

done

>that fucking captcha
>>
>>59864606
C++ only

>>59864594
i cant find it, is it
>>
>>59863070
without opening the thread
>presumably have width/height getters for both
>just make sure that for every frame, the pixels described by the origin plus either width or height (plut a buffer) do not equal any pixels within the other square(area determined the same way)
>have to move the origin of one or the other to accomplish this on the next frame
I don't think I forgot much
>>
>>59864687
find the delta is the height of the 3rd square formed by them overlapping?
>>
Fuck you op, sage
>>
>>59864400
>OP Here:
Can't you just use the name field and a tripcode as they were intended, this is giving me second hand inconvenience annoyance, it will save you a whole few seconds and be more noticeable for readers anyway.
>>
OP Here:

It has been over 2 hours and nobody can figure this out?!!!!!!!!!!!!!
>>
I'm going to attempt to improve the quality of this board by posting a useful link that will be of interest to anyone who doesn't already know how to solve this.

http://www.metanetsoftware.com/technique/tutorialA.html

In the future please fuck off with your bullshit reply bait threads.
>>
>>59865578
Not OP:

this isnt related to thread, sage
>>
>>59863479
Actually no it isn't
Coordinate systems are fully rotatable, absolutely nothing says we're not dealing with a rotated cartesian system
>>
>>59864633
>C++ only
Do your own homework, faggot
>>
>>59865675
fine it can be C, whatever, just do it.

PS this is not homework, gay
>>
>>59863070
Why the fuck do you randomly draw an image that is supposed to show you the problem when it has nothing to do with the question?
That shows lack of team communication and thus, showing incompetence in the company.
Kill yourself.
>>
Not trolling or something but if you cant solve this then programming isnt for you, this shit is basic to be honest.
Thread posts: 66
Thread images: 6


[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.