Format fix 2013/morgan1/README.md

This commit is contained in:
Cody Boone Ferguson committed 2023-10-15 10:15:05 -07:00
1 parent 3f78718eda
commit aece18bb2c
1 file changed
+42 -32
+42 -32
View File
@@ -1,7 +1,7 @@
# Smallest large system simulator # Smallest large system simulator
Yves-Marie Morgan Yves-Marie Morgan<br>
<yves-marie.morgan@parrot.com> <yves-marie.morgan@parrot.com>
## To build: ## To build:
@@ -37,33 +37,36 @@ observing site.
### Instructions ### Instructions
It displays the position of the 8 planets of the solar system around the sun. It displays the position of the 8 planets of the solar system around the Sun.
The date given in the command line is in the format YYYY/MM/DD (year, month and The date given in the command line is in the format YYYY/MM/DD (year, month and
day). The direction keys can be used to move in time : day). The direction keys can be used to move in time :
Left : go back 1 day. * Left : go back 1 day.
Right : go forward 1 day. * Right : go forward 1 day.
Down : go back 20 days. * Down : go back 20 days.
Up : go forward 20 days. * Up : go forward 20 days.
It handles correctly all leap years and the switch between julian calendar and It handles correctly all leap years and the switch between [Julian
gregorian calendar (10 days missing between 1582/10/04 and 1582/10/15). calendar](https://en.wikipedia.org/wiki/Julian_calendar) and
[Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar) (10 days
missing between 1582/10/04 and 1582/10/15).
The scale is logarithmic to be able to display the 8 planets without having The scale is logarithmic to be able to display the 8 planets without having
Mercury, Venus, Earth and Mars squizzed around the sun. Mercury, Venus, Earth and Mars squeezed around the Sun.
The size is not proportinal either. The size is not proportional either.
### Bonus ### Bonus
It also displays the position of 2 famous comets during their last approach : It also displays the position of 2 famous comets during their last approach:
- The first one arround the third IOCCC.
- The first one around the third IOCCC.
- The second one between the thirteenth and fourteenth IOCCC. - The second one between the thirteenth and fourteenth IOCCC.
### Limitations ### Limitations
* ASCII character set is assumed. * ASCII character set is assumed.
* a c99 compiler is required (for some math.h functions). * A C99 compiler is required (for some `math.h` functions).
* The position should be correct for years between (-1000; +3000) * The position should be correct for years between (-1000; +3000)
* The approximations done in the formula are OK for displaying the * The approximations done in the formula are OK for displaying the
position around the sun but not for other applications like ephemeride or position around the sun but not for other applications like ephemeride or
@@ -72,33 +75,40 @@ It also displays the position of 2 famous comets during their last approach :
### Obfuscation ### Obfuscation
* Reuse of 1 letter variables. * Reuse of 1 letter variables.
* Only the main function with some for loops. * Only the main function with some `for` loops.
* Constants for orbital elements encoded in a string. * Constants for orbital elements encoded in a string.
* Hexadecimal and decimal values used inconsitentely. * Hexadecimal and decimal values used inconsistently.
* Comparisons order are not consitent. * Comparisons order are not consistent.
* A lot of stuff is done in the different parts of the for loop. * A lot of stuff is done in the different parts of the for loop.
### Compilation warnings ### Compilation warnings
with gcc 4.7.2 on Linux Ubuntu 12.10 : With gcc 4.7.2 on Linux Ubuntu 12.10:
* prog.c:38:3: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
* prog.c:40:34: warning: value computed is not used [-Wunused-value]
* prog.c:56:6: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
* prog.c:58:50: warning: value computed is not used [-Wunused-value]
* prog.c:61:5: warning: suggest parentheses around ‘-’ inside ‘>>’ [-Wparentheses]
with clang 3.1 on Linux Ubuntu 12.10 : ```
* prog.c:38:49: warning: '&&' within '||' [-Wlogical-op-parentheses] prog.c:38:3: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
* prog.c:38:27: warning: '&&' within '||' [-Wlogical-op-parentheses] prog.c:40:34: warning: value computed is not used [-Wunused-value]
* prog.c:55:13: warning: '&&' within '||' [-Wlogical-op-parentheses] prog.c:56:6: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
* prog.c:56:14: warning: '&&' within '||' [-Wlogical-op-parentheses] prog.c:58:50: warning: value computed is not used [-Wunused-value]
prog.c:61:5: warning: suggest parentheses around ‘-’ inside ‘>>’ [-Wparentheses]
```
Due to most parentheses and braces removed when unecessary. With clang 3.1 on Linux Ubuntu 12.10 :
```
prog.c:38:49: warning: '&&' within '||' [-Wlogical-op-parentheses]
prog.c:38:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
prog.c:55:13: warning: '&&' within '||' [-Wlogical-op-parentheses]
prog.c:56:14: warning: '&&' within '||' [-Wlogical-op-parentheses]
```
This is due to most of the parentheses and braces being removed when
unnecessary.
To verify the display, you can look at one of this programs : To verify the display, you can look at one of this programs :
* xephem : http://www.clearskyinstitute.com/xephem/ * xephem : https://web.archive.org/web/20130310133219/http://www.clearskyinstitute.com/xephem/
* homeplanet : http://www.fourmilab.ch/homeplanet/ * homeplanet : https://www.fourmilab.ch/homeplanet/
* http://www.theplanetstoday.com/ * https://www.theplanetstoday.com
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License: