CSE Valley

When the fire nation started attacking the COMP1511 Land, citizens were forced to go back to basics. They began farming to meet their daily needs. As an aspiring developer in COMP1511 Land, your first task is to create a simulation called cse_valley, which mimics everyone's environment.

Note: At time of release of this assignment (Week 4), COMP1511 has not yet covered all of the techniques and topics necessary to complete the later stages of the assignment. At the end of Week 3, the course has covered enough content to be able to read in a single command and process that input. However, you have not yet seen two dimensional arrays or be able to handle multiple commands ending in End-of-Input (Ctrl-D). We will be covering these topics in the lectures, tutorials, labs, and a live stream in Week 4. The links for these have been shared in the Week 4 announcement.

Overview

Assignment Livestream

The Assignment Livestream is scheduled for Thursday, Week 4 18:30-19:30. After that time, it will be available here.

The World!

cse_valley is a simple world, basically a grid and everything must occur here. Your job is to act as a farmer to seed, grow, harvest, and trade plants for your wellbeing. The success of your career depends on how you navigate this challenging world.

The image below visualises what this world looks like where you, the farmer, begin your journey!

struct land

Provided Structs

You have been provided with 3 existing struct data types to help you with your implementation of this simulation.

These structs and their purposes are shown below.

  • struct land
    • Purpose: To store the state of an individial block of land.
    • Contains:
      • intis_watered - represents if this particular block of land is currently watered.
      • charseed_name - stores the single letter name of the seed currently planted in this block of land.
    • Hint: You should not need to use this struct until Stage 2.
    • struct land
  • struct seeds
    • Purpose: To store information about a single type of seed.
    • Contains:
      • charname - stores the single letter name of this type of seed.
      • intamount - stores the number of available seeds to plant of this type (not including the amount currently planted).
    • Note: name is initialised to NO_SEED and seed can only have lowercase letters (i.e. between 'a' and 'z' inclusive) as its name.
    • struct land
  • struct farmer
    • Purpose: To store the current state of a farmer.
    • Contains:
      • intcurr_col - stores the current column coordinate of the farmer.
      • intcurr_row - stores the current row coordinate of the farmer.
      • intcurr_dir - stores a character representing the direction the farmer is currently facing.
    • Note: curr_dir can only have values of >, <, v, and ^, representing facing right, left, up, and down respectively.
    • struct land

The Commands

As part of running the simulation, you as the aspiring developer of COMP1511 Land need to allow for commands to be given to your program. These commands are how you will interact with the game. The simulation runs through 2 modes, setup and game.

  1. Setup: This is where the user sets the number of and type of seeds initially avaliable to the farmer. This is further explained in Stage 1.1
  2. Game: This is the main game mode. Commands are read in indefinitely, until EOF.
    • Each command given to the program will be a combination of char and integers.
    • There could be a large number of lines of input, so you must not store all the commands in an array — you should scan them in individually.
    • Depending on the initial command argument character, you will have to scan in a differing number of additional variables (called "arguments"). For example, in Stage 1.2, the “Printing One Seed” command requires a command argument s, followed by an additional argument that specifies the name of the seed to be printed.
    • The specifics of the commands are detailed in a series of stages below.

Allowed C Features

In this assignment, there are no restrictions on C Features, except for those in the Style Guide.

We strongly encourage you to complete the assessment using only features taught in lectures up to and including Week 4. The only C features you will need to get full marks in the assignment are:

  • int variables
  • char variables
  • if statements, including all relational and logical operators
  • while loops
  • printf and scanf
  • structs
  • arrays, including two dimensional arrays
  • Your own helper functions

Using any other features will not increase your marks (and will make it more likely you make style mistakes that cost you marks).

If you choose to disregard this advice, you must still follow the Style Guide. You also may be unable to get help from course staff if you use features not taught in COMP1511.

Features that the Style Guide strongly discourages or bans will be penalised during marking.

Reference Implementation

To help you understand the proper behaviour of CSE Valley, we have provided a reference implementation. If you have any questions about the behaviour of CSE Valley, you can check them against this reference implementation.

To access the reference Implementation

1511 cse_valley

How To Get Started

There are a few steps to getting started with CSE Valley.

  1. Create a new folder for your assignment work and move into it.
    mkdir ass1
    cd ass1
  2. Download the starter code (cse_valley.c) here or use this command on your CSE account to copy the file into your current directory:

cp -n /web/cs1511/21T3/activities/cse_valley/cse_valley.c .
  • Run 1511 autotest to make sure you have correctly downloaded the file.
    1511 autotest cse_valley
  • Spend a few minutes playing with the reference solution -- get a feel for how the assignment works.
    1511 cse_valley
  • Read through Stage 1, which is below.
  • Think about your solution, draw a diagram of thefarm_land to help you get started
  • Start coding!
  • About the Starter Code

    The provided starter code has done some setup for you. This is explained below.

    Before the main function, the starter code has:

    1. Imported libraries, defined some initial #define's, and defined the structs described above
    2. Declared some functions, which are used to setup the game. You do not need to use these functions!
    3. Declared aprint_land function which you will have to use in stage 2.

    In the main function, the starter code has:

    1. Declared and initialised an instance of a struct farmer called cse_farmer.
      • This sets farmer's curr_col and curr_row to be 0, and curr_dir to be >.
    2. Declared and initialised a 2D array of struct land called farm_land.
      • This will set everyis_watered to be FALSE and every seed_name to be NO_SEED for all elements on the 2D array.
    3. Declared and initialised a regular 1D array of struct seeds called seed_collection.
      • This will set everyamount to be 0 and every name to be NO_SEED for all elements in the array.
    4. This is where you write your code!

    Your Tasks

    This assignment consists of four stages. Each stage builds on the work of the previous stage, and each stage has a higher complexity than its predecessor. You should complete the stages in order.

    Stage 1

    In this stage, you will implement:

    1. The ability to choose what seed types you would like to start with,
    2. The ability to print out the number of the different seed types that a farmer has,
    3. The ability to print out a specific type of seed and its amount.

    1.1: Scanning Different Seed Names

    To get everyone started with their farms, all farmers will receive 60 seeds each. As a farmer, you will be able to say how many different seeds you wish to have (from 1 to 5 inclusive) and what their different names are. The 60 seeds will be then split equally amongst the different seed names you have specified.

    Invalid Inputs and Clarifications

    • We can assume that the farmer will only enter a number between 1 and 5 (inclusive) as the number of different seeds that they wish to have.
    • We can assume that the farmer will not put in the same seed names.
    • We can assume that the farmer will only put in a lowercase alphabet character for each different seed name.
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: 
    

    1.2: Printing All Seeds

    A farmer should be able to find out their seeds inventory. This is done in the simulation using the Printing All Seeds command. This command will print all the current seeds that a farmer has at their disposal, in the order the seeds were initialised.

    The Printing All Seeds command is specified by the command argument a. The output should be given in the following format:

      Seeds at your disposal:
      - m seed(s) with the name 'n'
      ...
    

    where m is the amount of seeds with the name n for all seeds that the farmer currently has.

    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: a
      Seeds at your disposal:
      - 20 seed(s) with the name 'b'
      - 20 seed(s) with the name 'c'
      - 20 seed(s) with the name 'a'
    Enter command: 
    

    1.3: Printing One Seed

    In order to be able to plan their day of seed planting, a farmer needs to be able to find out the amount of seeds of a particular type. This is done through the Printing One Seed command. The command is specified by the character s, followed by the seed_name the farmer wish to find out. The output should be given in the format:

      There are m seeds with the name 'n'
    

    where m is the number of seeds and n is the name of the seed.

    Invalid Inputs and Clarifications

    • If the farmer puts in an invalid seed name (i.e. something other than a lowercase letter), your program should give an output of:
        Seed name has to be a lowercase letter
      
    • If the farmer asks you to print out a valid seed name that you do not have in your collection, your program should give an output of:
        There is no seed with the name 'n'
      
      where n is the seed_name.

    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 2
    Enter the names of the seeds to be given:
    b
    c
    Game Started!
    Enter command: s b
      There are 30 seeds with the name 'b'
    Enter command: s a
      There is no seed with the name 'a'
    Enter command: s ?
      Seed name has to be a lowercase letter
    Enter command: 
    

    Testing & Submission

    Are you finished with this stage? If so, you should make sure to do the following:

    • Run 1511 style, and to clean up any issues a human might have reading your code. Don't forget -- 20% of your mark in the assignment is based on style!
    • Autotest for this stage of the assignment by running the autotest-stage command as shown below.
    • Remember -- give early, and give often. Only your last submission counts, but why not be safe and submit right now?
    1511 style cse_valley.c
    1511 autotest-stage 01 cse_valley 
    give cs1511 ass1_cse_valley cse_valley.c
    

    Stage 2

    In this stage, you will implement:

    1. The ability to use a provided function to print the current state of the farm,
    2. The ability for the farmer to move around the farm,
    3. The ability for the farmer to attend to an adjacent land,
    4. The ability for the farmer to scatter (plant multiple) seeds from where they are to the edge of the farm that they are currently facing (right and downwards direction only).

    2.1: Printing Land

    Though normally we would always be able to see the state of the land in real life at any point in time, in a simulation, this is not always practical. Hence, the simulation needs a Printing Land command which prints the state of the land on that moment. The command is specified by the argument l. This command needs to call the function print_land.

    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    2.2: Moving Around the Farm

    A farmer will need to move around the land to attend to their farm. Hence, the simulation needs to be able to track and show a farmer's movements. Currently, the Moving Commands are specified by the characters >, <, ^, and v that corresponds to moving to the right, left, up, and down respectively.

    At the start of the simulation, the farmer is located at the top left corner (row 0, col 0) of the farm, facing to the right (i.e. cse_farmer.curr_col and cse_farmer.curr_row are both 0 and cse_farmer.curr_dir is >).

    To move to an adjacent struct land, the farmer must already be facing that direction. This means that the farmer can only go from (row 0, col 0) to (row 0, col 1) by putting in the > command. Any other movement commands would change the farmer's direction to the given command. The same command would need to be given again for the farmer to actually move in that direction.

    Invalid Inputs and Clarifications

    • A farmer can't go outside outside the boundary of the farm. (E.g if the farmer is currently located in (row 0, col 0) and facing up, the command ^ will not do anything)
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: >
    Enter command: >
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |   |   | f>|   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    
    no directions changed
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: v
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: v
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: >
    Enter command: v
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    
    changed directions

    2.3: Attending to an Adjacent Land

    A farmer should be able to take care of the adjacent land that they are currently facing. If the farmer wishes to water the land, the o command argument will be followed by the character w. Similarly, if the farmer wishes to plant a seed into the land, the o command argument will be followed by the character p and the seed_name that the farmer wishes to plant.

    The pre-made print_land function shows any land that is watered by having a W printed on the top right section of the land. Similarly, it shows any land that has a seed planted by having the name of the seed printed on the top left section of the land.

    Invalid Inputs and Clarifications

    • Trying to plant a seed or water into a land that is outside the boundary of the farm will not do anything.
    • When a piece of land is watered, then it will stay watered when watered again, i.e. you cannot unwater land
    • A seed that has been previously planted on the land spot prior to the command will be replaced by the new seed.
    • You can assume that the farmer will always plant a seed that they own (i.e. in seed_collection). In other words, you will never be asked to plant a seed you do not have in your seed_collection.
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: o w
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |  W|   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: v
    Enter command: o w
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |  W|   |   |   |   |   |   |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |  W|   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    
    water adjacent animation
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: o p b
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |b  |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: v
    Enter command: o p a
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |b  |   |   |   |   |   |   |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |a  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: a
      Seeds at your disposal:
      - 19 seed(s) with the name 'b'
      - 20 seed(s) with the name 'c'
      - 19 seed(s) with the name 'a'
    Enter command: 
    
    plant adjacent animation gif

    2.4: Scattering Seeds

    In order to plant more seeds faster, farmers can use a tool which scatters (plants multiple) seeds in one direction, either until the edge of the farm, or until they run out of seeds. Unfortunately (since the wind in COMP1511 land always blows south or east), this tool only works if the farmer is facing down, or to the right. Specifically:

    • First, perform error checking for invalid inputs as described in the "Invalid Inputs" section.
    • If the farmer is facing left (i.e. <) or up (i.e. ^), this command should do nothing, except print out the following error message:
        You cannot scatter seeds ^ or <
      
    • If the farmer is facing down (i.e. v), a line of seeds should be planted, starting at the farmer, going until either you run out of seeds, or you reach the bottom of the farm.
    • If the farmer is facing right (i.e. >), a line of seeds should be planted, starting at the farmer, going until either you run out of seeds, or you reach the rightmost edge of the farm.
    This is done through the command argument p (for "plant multiple"), followed by the name of the seed that the farmer wishes to scatter.

    Invalid Inputs and Clarifications

    • Anything that has been previously planted on the land prior to the command should be replaced by the new seed.
    • Just like in Stage 1.3, If the seed name is not a lowercase letter, you should print:
        Seed name has to be a lowercase letter
      
    • if the seed is one you do not currently have, you should print:
        There is no seed with the name 'n'
      
      where n is the seed name.
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    a
    c
    Game Started!
    Enter command: >
    Enter command: >
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |   |   | f>|   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: p b
    Enter command: a
      Seeds at your disposal:
      - 14 seed(s) with the name 'b'
      - 20 seed(s) with the name 'a'
      - 20 seed(s) with the name 'c'
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |b  |b  |b  |b  |b  |b  |
    |   |   | f>|   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: v
    Enter command: p c
    Enter command: a
      Seeds at your disposal:
      - 14 seed(s) with the name 'b'
      - 20 seed(s) with the name 'a'
      - 12 seed(s) with the name 'c'
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |c  |b  |b  |b  |b  |b  |
    |   |   | f |   |   |   |   |   |
    |   |   | v |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |c  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    Testing & Submission

    Are you finished with this stage? If so, you should make sure to do the following:

    • Run 1511 style, and to clean up any issues a human might have reading your code. Don't forget -- 20% of your mark in the assignment is based on style!
    • Autotest for this stage of the assignment by running the autotest-stage command as shown below.
    • Remember -- give early, and give often. Only your last submission counts, but why not be safe and submit right now?
    1511 style cse_valley.c
    1511 autotest-stage 02 cse_valley 
    give cs1511 ass1_cse_valley cse_valley.c
    

    Stage 3

    In this stage, you will implement:

    1. The ability to water a square of the land in one go,
    2. The ability for the farmer to move to the next day and harvest a plant,
    3. The ability to trade seeds.

    3.1: Square Watering

    One perk of being in the COMP1511 Land is the ability to summon the god of rain, known as the Square Watering command. This command is specified by the argument w, followed by a number representing the size of the square section of the farm land.

    To demonstrate this, say you are on (row 2, col 3) of the farm. When the command of w 2 is played, all the land from row 0 (2 - 2) and col 1 (3 - 2) until row 4 (2 + 2) and col 5 (3 + 2) now become watered (as shown in the image and in Example 3.1.1)

    explaining above paragraph in a picture

    Invalid Inputs and Clarifications

    • If the farm puts in a negative number as the size, your program should output:
        The size argument needs to be a non-negative integer
      
    • When a piece of land is watered, then it will stay watered when watered again, i.e. you cannot unwater land
    • The farmer will still be watering even if some of the expected squares are outside of the whole farm (as shown in the Example 3.1.2)
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    a
    c
    Game Started!
    Enter command: >
    Enter command: >
    Enter command: >
    Enter command: v
    Enter command: v
    Enter command: v
    Enter command: w 2
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |  W|  W|  W|  W|  W|   |   |
    |---|---|---|---|---|---|---|---|
    |   |  W|  W|  W|  W|  W|   |   |
    |---|---|---|---|---|---|---|---|
    |   |  W|  W|  W|  W|  W|   |   |
    |   |   |   | f |   |   |   |   |
    |   |   |   | v |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |  W|  W|  W|  W|  W|   |   |
    |---|---|---|---|---|---|---|---|
    |   |  W|  W|  W|  W|  W|   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    a
    c
    Game Started!
    Enter command: w 1
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |  W|  W|   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |  W|  W|   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    3.2: Advancing to the Next Day and Harvesting

    a. Advancing to the Next Day

    Once you have done your farming for the day, you can go to the next day using the Advancing to the Next Day command, which is specified by the character n. It should give an output of which day you are heading into. For example, the first time you enter the command, it should say

      Advancing to the next day... Day 2, let's go!
    

    When you advance to the next day, the following things will happen:

    • If a seed has been planted in a particular struct land and that particular struct land has been watered, the seed would have grown into a plant that is able to be harvested on the day.
    • Seeds that are not watered when advancing to the next day will die
    • Harvestable plants that are not harvested when advancing to the next day will die
    • All land becomes unwatered and farmer is reinitialised to be facing to the right and located at the top left corner of the farm (just like at the start of the simulation)

    b. Harvesting Adjacent Land

    Aside from planting and watering into a land, you can also harvest plants. Just like the water adjacent land command, a farmer could harvest an adjacent land that they are currently facing using the character h. When harvesting a plant, you get 5 seeds of the same type.

    • When a plant is able to be harvested, it should output:
        Plant 'X' was harvested, resulting in 5 'x' seed(s)
      
      where X is the harvested plant (i.e. uppercase form) and x is the name of the seeds received (i.e. lowercase form).

    Invalid Inputs and Clarifications

    • Trying to harvest a plant from a land that is outside the boundary of the farm will not do anything.
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    a
    c
    Game Started!
    Enter command: p a
    Enter command: o w
    Enter command: v
    Enter command: p b
    Enter command: o w
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |b  |a W|a  |a  |a  |a  |a  |a  |
    | f |   |   |   |   |   |   |   |
    | v |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b W|   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |b  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: n
      Advancing to the next day... Day 2, let's go!
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |A  |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |B  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: a
      Seeds at your disposal:
      - 12 seed(s) with the name 'b'
      - 12 seed(s) with the name 'a'
      - 20 seed(s) with the name 'c'
    Enter command: h
      Plant 'A' was harvested, resulting in 5 'a' seed(s)
    Enter command: a
      Seeds at your disposal:
      - 12 seed(s) with the name 'b'
      - 17 seed(s) with the name 'a'
      - 20 seed(s) with the name 'c'
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |B  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: n
      Advancing to the next day... Day 3, let's go!
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    3.3: Trading Seeds

    An important activity of COMP1511 Land is the ability to trade your seeds with others. This is done through the Trading Seeds command using the t argument, followed by 3 (three) additional arguments: the name of the seed that you have and wish to trade and its amount, in adition to the name of the seed that you want to trade for.

    Trading can result in you receiving seeds you have not had before. If this happens, you should ensure they appear first when you use the a command. A portion of the marks for seed trading relies on you implementing this behaviour correctly.

    A few things to note:

    • When the farmer tries to put in seed names that are not lowercase letters, your program should output:
        Seed name has to be a lowercase letter
      
    • When the farmer tries to put in a negative number of seeds, your program should output:
        You can't trade negative seeds
      
    • When the farmer does not have the seeds that they wish to trade, your program should do nothing except output:
        You don't have the seeds to be traded
      
    • When the farmer does not have enough seeds that they wish to trade, your program should output:
        You don't have enough seeds to be traded
      
    • You should check for validity in the order listed above
    ./cse_valley
    Welcome to CSE Valley, farmer!
    Congratulations, you have received 60 seeds.
    How many different seeds do you wish to have? 3
    Enter the names of the seeds to be given:
    b
    c
    a
    Game Started!
    Enter command: a
      Seeds at your disposal:
      - 20 seed(s) with the name 'b'
      - 20 seed(s) with the name 'c'
      - 20 seed(s) with the name 'a'
    Enter command: t a -5 b
      You can't trade negative seeds
    Enter command: t d 5 b
      You don't have the seeds to be traded
    Enter command: t a 21 b
      You don't have enough seeds to be traded
    Enter command: t c 10 b
    Enter command: a
      Seeds at your disposal:
      - 30 seed(s) with the name 'b'
      - 10 seed(s) with the name 'c'
      - 20 seed(s) with the name 'a'
    Enter command: t c 10 d
    Enter command: a
      Seeds at your disposal:
      - 10 seed(s) with the name 'd'
      - 30 seed(s) with the name 'b'
      - 0 seed(s) with the name 'c'
      - 20 seed(s) with the name 'a'
    Enter command: 
    

    Testing & Submission

    Are you finished with this stage? If so, you should make sure to do the following:

    • Run 1511 style, and to clean up any issues a human might have reading your code. Don't forget -- 20% of your mark in the assignment is based on style!
    • Autotest for this stage of the assignment by running the autotest-stage command as shown below.
    • Remember -- give early, and give often. Only your last submission counts, but why not be safe and submit right now?
    1511 style cse_valley.c
    1511 autotest-stage 03 cse_valley 
    give cs1511 ass1_cse_valley cse_valley.c
    

    Stage 4

    In this stage, you will implement:

    • The ability for the state of the land to change depending on the disaster.

    Each farmer also wants to be able to simulate what happens when their farm is hit by natural disasters. There are two possible natural disasters that could exist in COMP1511 Land, droughts and wind-storms. More information about each natural disaster can be found below.

    4.1: Natural Disasters - Droughts

    In order for any plant in the land to survive in a drought, it needs to not be surrounded by too many other plants. The more plants nearby, the more competition there is for the nutrients in the soil. Hence, if there are too many plants surrounding a plant, then that particular plant will die. The Droughts command is specified by the character d to specify that it is a natural disaster, followed by another d to further specify that it is a drought, followed by the minimum number of plants in the plant's adjacent lands for a plant to die following this command.

    Adjacent lands are the lands that are within 1 column/row away from a particular land. For example, surrounding lands of (1, 1) are (0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), and (2, 2).

    Invalid Inputs and Clarifications

    • Nothing happens to the state of water in a land in a disaster
    ./cse_valley
    ...
    ...Some earlier commands were used and not shown here...
    ...
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |b  |b  |b  |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |b  |b  |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |b  |b  |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |   |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |c  |   |
    |---|---|---|---|---|---|---|---|
    Enter command: d d 5
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |b  |   |b  |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |b  |   |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |   |   |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |c  |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    4.2: Natural Disasters - Wind Storms

    Unlike in a drought, in order for any plant to survive in a wind storm, it needs to now be surrounded by a certain number of plants so that it can be shielded in a cluster to survive the wind. Hence, if there are too few plants surrounding a plant, then that particular plant will die after a wind storm. The Wind Storm command is specified by the character d to specify that it is a natural disaster, followed by w to specify that it is a wind storm, followed by the minimum number of plants in the plant's adjacent lands for a plant to survive following this command.

    ./cse_valley
    ...
    ...Some earlier commands were used and not shown here...
    ...
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |b  |b  |b  |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |a  |a  |   |b  |b  |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |b  |b  |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |   |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |d  |d  |d  |d  |   |   |c  |   |
    |---|---|---|---|---|---|---|---|
    Enter command: d w 5
    Enter command: l
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |b  |   |   |   |
    | f>|   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |b  |b  |b  |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |b  |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |d  |d  |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |d  |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |d  |d  |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    |   |   |   |   |   |   |   |   |
    |---|---|---|---|---|---|---|---|
    Enter command: 
    

    Testing & Submission

    Are you finished with this stage? If so, you should make sure to do the following:

    • Run 1511 style, and to clean up any issues a human might have reading your code. Don't forget -- 20% of your mark in the assignment is based on style!
    • Autotest for this stage of the assignment by running the autotest-stage command as shown below.
    • Remember -- give early, and give often. Only your last submission counts, but why not be safe and submit right now?
    1511 style cse_valley.c
    1511 autotest-stage 04 cse_valley 
    give cs1511 ass1_cse_valley cse_valley.c
    

    Table of Commands

    Summary of All Commands
    StageCommand NameCommand ArgumentAdditional Arguments
    1.2Printing All Seeds a
    1.3Printing One Seed s seed_name
    2.1Printing Land l
    2.2aMoving Upwards ^
    2.2bMoving Right >
    2.2cMoving Downwards v
    2.2dMoving Left <
    2.3aWatering an Adjacent Land o w
    2.3bPlanting on an Adjacent Land o pseed_name
    2.4Scattering Seeds pseed_name
    3.1Watering a Square wsquare_size
    3.2aAdvancing to the Next Day n
    3.2bHarvesting an Adjacent Plant h
    3.3Trading Seeds tsrc_name src_amt dst_name
    4.1Expriencing Droughts d dmin_num_plants_to_die
    4.2Experiencing Wind Storms d wmin_num_plants_to_survive

    Assessment

    Assignment Conditions

    • Joint work is not permitted on this assignment.

      This is an individual assignment.

      The work you submit must be entirely your own work. Submission of any work even partly written by any other person is not permitted.

      Except, you may use small amounts (< 10 lines) of general purpose code (not specific to the assignment) obtained from a site such as Stack Overflow or other publically available resources. You should attribute clearly the source of this code in an accompanying comment.

      Assignment submissions will be examined, both automatically and manually for work written by others.

      Do not request help from anyone other than the teaching staff of COMP1511, e.g. in the course forum & help sessions.

      Do not post your assignment code to the course forum - the teaching staff can view assignment code you have recently autotested or submitted with give.

      Rationale: this assignment is designed to develop the individual skills needed to produce an entire working program. Using code written by or taken from other people will stop you learning these skills. Other CSE courses focus on the skill needed for work in a team.

    • The use of code-synthesis tools, such as GitHub Copilot, is not permitted on this assignment.

      Rationale: this assignment is intended to develop your understanding of basic concepts. Using synthesis tools will stop you learning these fundamental concepts.

    • Sharing, publishing, distributing your assignment work is not permitted.

      Do not provide or show your assignment work to any other person other than the teaching staff of COMP1511. For example, do not message your work to friends.

      Do not publish your assignment code via the internet. For example, do not place your assignment in a public GitHub repository..

      Rationale: by publishing or sharing your work you are facilitating other students using your work which is not permitted. If they submit your work, you may become involved in an academic integrity investigation.

    • Sharing, publishing, distributing your assignment work after the completion of COMP1511 is not permitted.

      For example, do not place your assignment in a public GitHub repository after COMP1511 is over.

      Rationale: COMP1511 sometimes reuses assignment themes using similar concepts and content. Students in future terms find your code and use it which is not permitted and you may become involved in an academic integrity investigation.

    Violation of the above conditions may result in an academic integrity investigation with possible penalties, up to and including a mark of 0 in COMP1511 and exclusion from UNSW.

    Relevant scholarship authorities will be informed if students holding scholarships are involved in an incident of plagiarism or other misconduct. If you knowingly provide or show your assignment work to another person for any reason, and work derived from it is submitted you may be penalised, even if the work was submitted without your knowledge or consent. This may apply even if your work is submitted by a third party unknown to you.

    Note, you will not be penalised if your work is taken without your consent or knowledge.

    For more information, read the UNSW Student Code, or contact the course account.

    Submission of Work

    You should submit intermediate versions of your assignment. Every time you autotest or submit, a copy will be saved as a backup. You can find those backups here, by logging in, and choosing the yellow button next to 'cse_valley.c'.

    Every time you work on the assignment and make some progress you should copy your work to your CSE account and submit it using the give command below.

    It is fine if intermediate versions do not compile or otherwise fail submission tests.

    Only the final submitted version of your assignment will be marked.

    You submit your work like this:

    give cs1511 ass1_cse_valley cse_valley.c
    

    Assessment Scheme

    This assignment will contribute 15% to your final mark.

    80% of the marks for this assignment will be based on the performance of the code you write in cse_valley.c

    20% of the marks for this assignment will come from hand marking of the readability of the C you have written. These marks will be awarded on the basis of clarity, commenting, elegance and style. In other words, your tutor will assess how easy it is for a human to read and understand your program. The utility 1511 style can help with this!

    Marks for your performance will be allocated roughly according to the below scheme.

    100% for Performance Completely Working Implementation, which exactly follows the spec.
    90% for Performance Completely working implementation of Stage 1, 2 and 3.
    65% for Performance Completely working implementation of Stage 1 and 2.
    50% for Performance Completely working implementation of Stage 1 and Stage 2, except for the Scattering Seeds command.
    30% for Performance Completely working implementation of Stage 1.
    20% for Performance Completely working implementation of Inheriting Seeds and Printing All Seeds commands.

    Marks for your style will be allocated roughly according to the scheme below

    100% for Style Perfect style
    90% for Style Great style, almost all style characteristics perfect.
    80% for Style Good style, one or two style characteristics not well done.
    70% for Style Good style, a few style characteristics not well done.
    60% for Style OK style, an attempt at most style characteristics.
    <= 50% for Style An attempt at style.

    The following is an indicative list of characteristics of your program that will be assessed, though your program will be assessed holistically so other characteristics may be assessed too:

    • Header Commenting (including your zID, and a short description of the program).
    • Consistent, sensible indenting.
    • Using Blank Lines & Whitespace.
    • Using constants.
    • Decomposing code into functions where relevant (especially after Stage 2).
    • Using comments effectively (at least at top of functions, and not containing irrelevant info).
    Note that the following penalties apply to your total mark for plagiarism:
    0 for the assignment Knowingly providing your work to anyone and it is subsequently submitted (by anyone).
    0 for the assignment Submitting any other person's work. This includes joint work.
    0 FL for COMP1511 Paying another person to complete work. Submitting another person's work without their consent.

    The course staff may vary the assessment scheme after inspecting the assignment submissions but it will remain broadly similar to the description above.

    Due Date

    This assignment is due 27 October 2021 20:00:00. For each hour after that time, the maximum mark it can achieve will be reduced by 3%.
  • For instance, at 30 minutes past the due date, the maximum mark you can get is 97%.
  • For instance, at 10 hours and 30 minutes past the due date, the maximum mark you can get is 67%.
  • For instance, at 20 hours and 30 minutes past the due date, the maximum mark you can get is 37%.
  • Change Log

    Version 0.01
    (2021-10-01 22:00)
    • Draft Version for tutors
    Version 1.0
    (2021-10-05 00:00)
    • Release to students
    Version 1.0.1
    (2021-10-07 11:00)
    • Update Section 2.4, to be clear about the error checking order
    Version 1.0.2
    (2021-10-08 10:10)
    • Removed requirement in 3.2b in which (ungrown) seed will cease to exist when attempted to be harvested to be in line with reference implementation
    Version 1.0.3
    (2021-10-08 15:10)
    • Added clarification that non-existent commands will not be tested on student's code.
    Version 1.0.4
    (2021-10-10 10:40)
    • Added clarification that user will always put the right command types.