![]() |
Quote:
|
Quote:
|
Quote:
|
They could:
1. Paint the lines so there's at least 2.5 units of space for each car. 2. Have offenders towed/exploded for not staying within the lines of their spot. So the solution to me is N / 2.5 |
How many floors does this parking lot contain?
|
Quote:
Quote:
|
Maybe just make a normal car park and you'd be right.
|
Quote:
|
Began the equation by assuming the fact that the lot was circular was essentially an extra detail that mattered very little to the eventual outcome since the circumference can basically be regarded as a circle laid out flat. So assuming a 100 unit long straight line, and a gap of 1 unit between the cars as the highest gap (rather than say 1.99999 repeated which would lead to 25 cars instead of whatever limit you said later), came up with this code that would linearly determine how many cars would fit.
PHP Code:
PHP Code:
The results if plotted for each random iteration would wind up being a sort of diamond leading around the value of min + max / 2, causing the average to approach that value. |
Quote:
|
Quote:
I'll adjust for that and shift to using an array since the gaps remaining integer makes the question tremendously easier. Or it'd be getting more complex into relational math where the fact that the car is tangent to whatever point on the circle has some profound effect on how the cars can align and modifying the math to account for that but I don't think that's what you were going for |
The length of the array is increased to units + 1 to reconcile the idea of each element of the array scaling from the beginning of that index that index to the beginning of the next, IE, 0-1, 1-2, ..., 100-0
It doesn't matter if temp.isgap starts as true or false, and it's possible to see a sort of representation of how the cars align by returning lot instead of this.parkedcars. Code: PHP Code:
PHP Code:
|
1 Attachment(s)
Quote:
|
Not gonna lie, I see this circular parking lot as this.
http://i1206.photobucket.com/albums/.../burnmoney.jpg and time |
lmao.
|
All times are GMT +2. The time now is 11:29 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.