project_phase-1 basic of programming

Upload: syed-rizwan-shah

Post on 04-Jun-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Project_Phase-1 Basic of Programming

    1/2

    1

    Basics of ProgrammingBS(SE)Section A1stSemester

    Project (Phase 1) At Max two students are allowed in a group

    Submission Date: 20th

    December2013till 11:55pm Mark

    Instructions:

    The project consists of three phases. Each phase will have a deadline. If you miss a deadline of a

    particular phase you will not be awarded any credit in that phase.

    Each next phase will be dependent on the previous phase, so you must start working on the project

    from day-1.

    You are required to work in Visual C++ 6.0 only.

    A group of maximum size two is allowed, this time make groups of your own choice.

    User Interface is important in this project. Try to develop an attractive user interface. Use of extra

    features in the project is encouraged.

    Use good programming practices (well commented and indented code; meaningful variable names,

    readable code etc.).

    Copy/cheating case will be awarded an 0 grade in the course.

    Email your .cpp file with your groupname and your name should be commented inside start file

    In this phase, you are required to specify the game area. The game area is a rectangular grid. You are

    required to draw the game area and a Robot inside this area. The rectangular grid is represented by a

    two dimensional array of size 24x79 (the console screen is 24x79. To draw the Grid and Robot you can

    use special characters (see ASCII table). Your screen must look like:

  • 8/13/2019 Project_Phase-1 Basic of Programming

    2/2

    2

    For this phase, you are required to move Robot only. On pressing A or left arrow key, the robot

    should move left and on pressing D or right arrow key the robot must move rightwards. Each time

    the robot is supposed to take a movement, you will clear the screen first and then you will draw the

    whole grid and Robot again on new location. For example, if head of the Robot is at co-ordinates (4, 5)

    on one step forward, the new location of head will be (4, 6) and same goes for the rest of all Robot

    components. Your Robot is the combination of different characters.

    Your Robot should not cross the boundary of your game. Make Proper boundary checks.

    Changing Font Color and Background Color in Visual C++

    You need to include following header file

    #include There are 16 colors available each given a number.

    0 = Black 8 = Gray1 = Blue 9 = Light Blue

    2 = Green A = Light Green3 = Aqua B = Light Aqua4 = Red C = Light Red

    5 = Purple D = Light Purple6 = Yellow E = Light Yellow7 = White F = Bright White

    Color attributes are specified by TWO hex digits -- the first corresponds to the background; the second the

    foreground. Each digit can be any of the following values:Sets the default console foreground and background colors.

    Examples

    Use following functionsystem(color 70)7 is white 0 is black. This will make white background and black font color.

    system("COLOR fc") produces light red on bright white

    How to Clear screen in VC++

    #include

    Use this functionsystem (cls)