tuto01 - CSCI3180 Principles of Programming Languages...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 2 and N curses Library Tutorial 4 CSCI3180 Principles of Programming Languages CSCI3180 Principles of Programming Languages
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Assignment 2
Image of page 2
Assignment 2 Game simulation ( Light Cycle in Tron ) Two light cycles competing in an arena Concurrent programming exercise (Admini strator-and-Worker) Implementation: the C language GNU/Linux with the GCC compiler User Interface: Ncurses Library Concurrent programming: Synchronous Int erprocess Messaging Project for LINUX ( SI MPL )
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Light Cycle Two kinds of players: Computer ( required ) Human ( optional , bonus points ) Initially, light cycles are placed in fixed positions facing each other. Walls of light are created behind the cycles as t hey move
Image of page 4
More Details Controls: Turn to East, South, West or North Use turbo boost A cycle loses immediately if it collides with the boundary of the arena , the wall created by other cycles or itself . All cycles advance simultaneously at a constant speed. Turbo boost can greatly increase the speed of a cycle The last cycle remains in the arena wins the game.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
More Details The arena A 200x100 rectangle The arena can be much larger than th e size of the window Only a part of the arena is visible in th e window
Image of page 6
Screen Output Wall of light Light cycles Border Arena
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Ncurses (new curses) Library
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern