Group_B_VirtualEscapeRoom
Functions
helper.c File Reference
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include "object.h"
#include "helper.h"
#include "execution.h"

Functions

int list_objects_at_location (OBJECT_t *location, type_t type)
 Lists all objects of a certain type in a given location. More...
 
void check_solved_stage1 ()
 Checks whether all puzzles in stage 1 has been solved. More...
 
void check_solved_stage2 ()
 Checks whether all puzzles in stage 2 has been solved. More...
 
void check_solved_stage3 ()
 Checks whether all puzzles in stage 3 has been solved. More...
 
void get_reward (int stage)
 Calculates the amount of hints used in that particular stage, and prints a reward. More...
 
void capitalize (char *word)
 Capitalize a string. More...
 

Function Documentation

◆ capitalize()

void capitalize ( char *  word)

Capitalize a string.

Modifies input by capitalizing each character

Parameters
[in,out]wordString to capitalize

◆ check_solved_stage1()

void check_solved_stage1 ( )

Checks whether all puzzles in stage 1 has been solved.

Checks if the conditions for revealing the first key have been met, and unlocks the silver key if so.

◆ check_solved_stage2()

void check_solved_stage2 ( )

Checks whether all puzzles in stage 2 has been solved.

Checks if the conditions for revealing the second key have been met, and unlocks the gold key if so.

◆ check_solved_stage3()

void check_solved_stage3 ( )

Checks whether all puzzles in stage 3 has been solved.

Checks if the conditions for revealing the third key have been met, and unlocks the ruby key if so.

◆ get_reward()

void get_reward ( int  stage)

Calculates the amount of hints used in that particular stage, and prints a reward.

Prints a reward based on how many hints were used. Reward stages are, in order of 0 hints used to 4 hints used:

  • Gold
  • Silver
  • Bronze
  • Lost Explorer
Parameters
[in]stageStage number

◆ list_objects_at_location()

int list_objects_at_location ( OBJECT_t location,
type_t  type 
)

Lists all objects of a certain type in a given location.

TODO

Parameters
[in]locationThe specific stage or location
[in]typeThe type of objects to show
Returns
The count of listed object, 0 in case of no list