Commit a279d4d9 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added ex06 feedback

parent b7f36685
/*
Pascal: Good, that works.
Note however, that the appropriate solution to "bad food" is not really
landing immediately.
Instead, when this exception is caught, you want to alleviate the issue such
that the program can then flow on normally.
*/
#include <iostream> // for std::cout
#include <stdexcept> // for std::runtime_error
......@@ -17,7 +27,7 @@ class Plane {
};
int main() {
// TODO: Modify this code so that the plane lands,
// TODO: Modify this code so that the plane lands,
// but serve_food is still called.
Plane plane;
plane.start();
......
/*
Pascal: Looks good.
Except that you're using the index boundaries of the genome inconsistently.
Once you're calling count_bad(number_of_genes), then in the other test you
only go up to number_of_genes-1.
You may also want to test more different genomes, in a loop maybe.
*/
/* Test that the genome is initialized with only good genes by default */
#include "genome.hpp"
......
# Pascal:
# I told you weeks ago that your code to choose between shared and static
# libraries doesn't work. And now you just go on and copy paste it here again,
# with exactly the same issue.
# It's okay to make mistakes, but you have to learn from them.
# require minimum version of CMake
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21)
# set name of project
project(RandomAndTimer)
......
/* Header file for random generator */
/*
Pascal: Looks good.
You may want to have two distinct types, one that is returned
by generate(), and one that is used for internal storage.
Note that the numbers stored internally can be much larger
than what can be returned by generate().
Why are min() and max() not const?
*/
#ifndef __RANDOM_H__
#define __RANDOM_H__
......
/*
Pascal:
Note that std::clock does not perform to the specs asked
for in the exercise sheet.
*/
#include "timer.hpp"
#include <ctime>
#include <stdexcept>
......
/*
Pascal:
Why do your functions have void arguments?
*/
/* Timer header file */
#ifndef __TIMER_H__
......@@ -12,11 +17,11 @@ class Timer {
void start(void); // start counting
void stop(void); // stop counting
result_t duration(void) const; // get number of seconds
private:
time_t start_time_;
result_t duration_;
bool running_; // running state
bool running_; // running state
};
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment