Due: Nov 3, Devon's birthday Grading: 9 points Grading: needed to do at least 3 of those, 6/9 if completed 1, 8/9 if completed 2, 9/9 if completed 3, 10/9 if completed more than 3, 1/2 credit possible for each one tried if compiled, isn't quite right Make a directory ~/HW/lab14/ Copy in ~jkinne/public_html/cs202-f2017/CLASS/planets/version2/* Complete at least 3 of the following? In your planets.cpp file, include a comment at the top saying which of these you think you have working correctly. Do the following ... 1. Put in a different system - https://en.wikipedia.org/wiki/Gliese_581 - new function load_gliese581 in objects.cpp, objects.h, and call that from main 2. Add p for pause/play 3. Add s for save, and save into the file planets_capture.txt - You can either get the screen (using getmaxyx, inch) and save that to a file. - Or you can set up some strings to write into with sprintf, with one for each row, and then write those to a file. 4a. Color - look up how to do color in curses. - Make black background and yellow for the planets. - Just get the color calls done inside w.init_curses - See http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html https://www.gnu.org/software/guile-ncurses/manual/html_node/Color-manipulation-routines.html - curses functions to use: has_colors, start_color, init_pair, attron, attroff 4b. Color - add as something in the object - adding color to object_t in objects.h, objects.cpp - for each object, don't change foreground color, just set the background - - for the solar system, use: sun - yellow, bold mercury - 8 (dark grey), bold venus - yellow earth - blue mars - red, bold jupiter - red saturn - magenta uranus - cyan neptune - blue pluto - no change in color - for the gliese581 system, use star - yellow, bold e - 8, bold b - yellow c - blue g - red, bold d - red 5. Add a display of how many seconds have eleapsed in the simulation. Add a double in the world_t to keep track, set to 0 initially, update in the update function, and display in the draw_curses 6. Add keys to zoom in/out. Handle < > in your world_t::input, and then use that to change the scale (< will *= 2, > /= 2). 7. Add keys to shift the display left/right. Handle arrow keys, and when pressed update some variable in the world_t object that is used in the draw_curses 8. Add a trail on each object, so we can see the orbits. Don't clear the screen in draw_curses. Instead, ... 9. Have at least two different systems to choose from (e.g., our solar system vs. gliese581) and use a command-line argument to select which one. 10. Fix a bug in the initial velocity calculation. The code in version2 initializes velocities for i=1 up to stuff.size()-1. That specifically does not put any velocity on the sun. This was because it wasn't working with the sun. The fix is to slightly change the initial velocity formulas so that they are for the center of mass /for all the objects except object i/. So for doing the sun, you would have the center of mass for everything except the sun. Fixing this bug would be necessary to get a decent simulation of things like binary systems. 11. Switch the main loop to again be having an if check with the clock() function to determine when to update the curses display. This will also require using the nodelay function rather than halfdelay in init_curses. 12. Fast calculation mode - add a setting to do that or not. Fast calculation, compute_g just has the loop for i, and then uses the center of mass. 13. Something else you want to do - ask me if it will count.