Planetary Alignment Formula
$30-100 USD
Dibayar semasa penghantaran
I am attempting to develop a space-based game; the universe consists of locations: empty space, a planet, or anomaly such as a black hole, meteor shower, etc.. While much of the universe is empty space, I want a calculated formula to change this.
The "galactic center" is 0,0. There are then four "quadrants": 0,1 to 65535,65535; ; 0,-1 to 65535,-65536; -1,0 to -65536, 65535 and -1,-1 to -65536, -65536.; you can treat locations in universe as either signed 32-bit or two signed 16-bit numbers.
I need a calculated formula, given location, generates a number from 0 to 12 (or 0 to 15 if it makes it easier) , 0 meaning empty space, 1 through 9 being planetary levels, and 10 and above anomalies. Should make planets more likely closer to 0, location at 20,75; 20,-75; -20,75; or -20,-75, is more likely planet than one at 2000,1000 etc. Probably "weight" levels for level 1 planets more common than level 2, so on up to level 9.
It doesn't matter what the calculations produce for 0,0; that one will be ignored.
I know this isn't hard because I saw a formula for it about 25 years ago. I've done programming for decades but I don't have the math background to do the calculation myself.
Note that this is a *calculated* formula, not a random one; the location of planets (or other anomalies) should be the same every time someone plays the game. So if 104,322 generates a level 6 planet, the formula generating the value for that location should *always* calculate 6. Does not use data storage; idea is to determine the locations of planets and other space anomalies programmatically as a calculated value rather than by reading a database.
This may either be a simple formula or a multiline procedure. The target language will probably be PHP but anything that produces the desired result that I can translate is ok; I can read code in Basic, Fortran, C, Pascal, Javascript, Python,and PHP languages.
What you can do to show your formula works is that if I input a series of locations, it shows the value it would generate, and if later I input the same location it would return the same value for that location. So you could write a simple program in Basic or a PHP-enhanced web page or whatever you want to generate the result.
## Deliverables
Again, I want, in effect, a function that, given the location in the universe, consistently returns the same value which tells whether that location is empty space, a planet from level 1 to 9, or an anomaly (values 10 and up). The location can either be treated as two 16-bit numbers or one 32-bit number. It should be a short function, probably no more than 5 or 10 lines (but the size is not critical, I just want to show for someone with the math background that it's not a huge project).
* * *This broadcast message was sent to all bidders on Wednesday Apr 7, 2010 9:57:29 AM:
I wish to thank all of you for the time you spent bidding on this proposal. To paraphrase a line from the play *A Chorus Line*, "I wish I could have used all of you, but unfortunately, I can't." I now understand what he meant by that statement, as all the proposals were interesting. I had a bit of a time choosing but in the end I made a decision, and, again, thank you all for your bid.
Paul
ID Projek: #3269190