Question: Please provide the full implementation of each function and make the necessary additional files please because I do not know how to implement it Provided
Please provide the full implementation of each function and make the necessary additional files please because I do not know how to implement it
Provided Functions:
Wall.h:
Interface to the Wall ADT
DO NOT MODIFY THIS FILE
#ifndef WALLH
#define WALLH
typedef struct wall Wall;
Rock colours
#define NUMCOLOURS
enums are used to create groups of related constants. It is like
creating multiple #defines, except you can also provide a type name.
typedef enum
NONE
GREEN
TEAL
PINK
RED
Colour;
Terminal output colours
#define GRN xBm
#define CYN xBm
#define MAG xBm
#define RD xBm
#define RESET xBm
struct rock
int row;
int col;
Colour colour;
;
Creates a new blank wall with the given dimensions
Wall WallNewint height, int width;
Frees all memory allocated to the wall
void WallFreeWall w;
Returns the height of the wall
int WallHeightWall w;
Returns the width of the wall
int WallWidthWall w;
Adds a rock to the wall
If there is already a rock at the given coordinates, replaces it
void WallAddRockWall w struct rock rock;
Returns the number of rocks on the wall
int WallNumRocksWall w;
Returns the colour of the rock at the given coordinates, or NONE if
there is no rock at those coordinates.
Colour WallGetRockColourWall w int row, int col;
Stores all rocks on the wall in the given rocks array and returns
the number of rocks stored. Assumes that the array is at least as
large as the number of rocks on the wall.
int WallGetAllRocksWall w struct rock rocks;
Stores all rocks that are within a distance of dist from the given
coordinates in the given rocks array and returns the number of rocks
stored. Assumes that the array is at least as large as the number of
rocks on the wall.
int WallGetRocksInRangeWall w int row, int col, int dist,
struct rock rocks;
Stores all rocks with the colour colour that are within a distance
of dist from the given coordinates in the given rocks array and
returns the number of rocks stored. Assumes that the array is at
least as large as the number of rocks on the wall.
int WallGetColouredRocksInRangeWall w int row, int col, int dist,
Colour colour, struct rock rocks;
Prints the wall out in a nice format
void WallPrintWall w;
#endif
climber.h:
Interface to boulder climbing algorithms
DO NOT MODIFY THIS FILE
#ifndef CLIMBERH
#define CLIMBERH
#include "Wall.h
struct path
int numRocks;
struct rock rocks;
;
struct path findShortestPathWall w int reach, Colour colour;
struct path findMinEnergyPathWall w int reach, int energyCostsNUMCOLOURS;
struct path findMinTurnsPathWall w int reach, int energyCostsNUMCOLOURS
int maxEnergy;
#
climber.c:
endif
Implementation of boulder climbing algorithms
#include
#include
#include
#include
#include
#include
#include "climber.h
#include "Wall.h
struct path findShortestPathWall w int reach, Colour colour
TODO Task
struct path p NULL;
return p;
struct path findMinEnergyPathWall w int reach, int energyCostsNUMCOLOURS
TODO Task
struct path p NULL;
return p;
struct path findMinTurnsPathWall w int reach, int energyCostsNUMCOLOURS
int maxEnergy
TODO Task
struct path p NULL;
return p;
We are allowed to create extra c and h files such as graph.c or graph.h for any extra functionsstructs we need to implement the task functions.
Please provide a solution that includes the implementation for the functions in climber.cPlease provide the exact code if possible if not please describe what I would need to do
Thanks
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
