Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subjects/banner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ println!("short hand: {}, long hand: {}, description: {}", d.short_hand, d.long_

An associated **type** called `Callback` will also be provided. It should represent a function pointer which is going to be used in the structure and functions below. This function will represent the callback for the flag associated to it.

A second structure named `FlagsHandler` will be given which just has one element: `flags: HashMap<(String, String), Callback>`. You'll also need to implement the following associated **functions**:
A second structure named `FlagsHandler` will be given which just has one element: `flags: HashMap<String, Callback>`. You'll also need to implement the following associated **functions**:

- `add_flag`, which adds the flag and callback function to the HashMap.
- `exec_func`, which executes the function using the flag provided and returns the result. The callback should be executed with the first two arguments of the supplied `argv` argument. Return either the successful result from the callback or the error stringified.
Expand Down
13 changes: 8 additions & 5 deletions subjects/drawing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ In order to compile and run `main.rs`, you'll need to define some structures. Yo

You'll also need to create the associated function `random` for `Line`, `Point` and `Circle`. You should derive their signatures from the usage.

Each shape must be drawn in a different color.

> Don't forget to add the dependencies in your Cargo.toml.

### Bonus

You may optionally implement the following shapes, including the structures and traits needed to draw them:

- `Pentagon`
- `Cube`

Expand All @@ -54,13 +57,13 @@ fn main() {

gs::Point::random(image.width, image.height).draw(&mut image);

let rectangle = gs::Rectangle::new(&gs::Point::new(150, 150), &gs::Point::new(50, 50));
let rectangle = gs::Rectangle::new(&gs::Point::new(150, 300), &gs::Point::new(50, 60));
rectangle.draw(&mut image);

let triangle = gs::Triangle::new (
&gs::Point::new(500, 500),
&gs::Point::new(250, 700),
&gs::Point::new(700, 800),
let triangle = gs::Triangle::new(
&gs::Point::new(500, 500),
&gs::Point::new(250, 700),
&gs::Point::new(700, 800),
);
triangle.draw(&mut image);

Expand Down
Loading