From a384e80ab7fd2f13b8d269c58a2c77c57a405746 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 21 Jan 2021 10:07:28 +0000 Subject: [PATCH 01/11] road_intersection: rust s raid 2 --- subjects/road_intersection/README.md | 77 ++++++++++++++++++++++ subjects/road_intersection/audit/README.md | 23 +++++++ 2 files changed, 100 insertions(+) create mode 100644 subjects/road_intersection/README.md create mode 100644 subjects/road_intersection/audit/README.md diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md new file mode 100644 index 00000000..52a6cfba --- /dev/null +++ b/subjects/road_intersection/README.md @@ -0,0 +1,77 @@ +## road_intersection + +### Objectives + +The objective of this raid is to create a traffic control strategy and represent it with an interface/UI. +Its up to you to decide which library and file system you want do use to create this simulation, but we recommend to use the library [sdl2](https://docs.rs/sdl2/0.34.3/sdl2/) + +### Instructions + +There exists various shapes of intersections, we will focus on the widely seen four-lane intersection. For simplicity each lane will have two directions + +```console + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | | ↑ | + |r0 r1 r2 | | +_______________________| ← ↓ → | |___________________ + | ↑ r3 + ← ← ← ← ← ← | ← r4 ← ← ← ← ← + | ↓ r5 +_________________________________|______________________________ + r11 ↑ | + → → → → → → r10 → | → → → → → → + r9 ↓ | +_______________________ | ____________________ + | | ← ↑ → | + | ↓ |r8 r7 r6 | + | ↓ | | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | | +``` + +There are 4 incoming lanes. Each lane has a set of consecutive unique ids `(ri, ri, ri)` where `(i = 0, 1, ⋯, 11)`, numbered in clockwise starting from the top-most. Each set of ids +indicates the outgoing direction of a vehicles. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. + +For this raid you must follow these assumptions: + +- Vehicles are to be **autonomous**, so Vehicles driving on a lane with a **given route** must follow the direction of that route, its not possible for the + driver to change lane. + +- Other traffic units such as pedestrians and emergency vehicles are not considered. + +- Vehicles can have different velocities, it is up to you to decide the velocity for each vehicle but it must be at least two different + velocities (0 does not count as a velocity for the vehicle). + +- Vehicles should not collide in a traffic lane it should be kept a safety distance from other vehicles + +#### **Stop conditions** + +Has you know vehicles must not collide, if so you must show some kind of feedback (logs, terminal display or canvas display its up to you to decide) so that the users can conclude +that the vehicles collided. Each lane will have a traffic light system (either imaginary of real), the objective is that each vehicle stops if there is any type of collision with other vehicles. Otherwise the vehicles can proceed in their lane. + +You are free to decide what algorithm you want to implement for the traffic light system, but keep in mind that traffic congestion should not be to high. + +### Example + +You can see some examples [here](TODO : link to the gifts). + +### Optional + +You can implement the following optional features : + +- A visualization of the traffic light, for example: a line that changes color from `Red` to `Green`. + +- Vehicle movement animation. You can find some cool assets : + - [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). + - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/) + +### Notions + +- https://docs.rs/sdl2/0.34.3/sdl2/ diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md new file mode 100644 index 00000000..596628a5 --- /dev/null +++ b/subjects/road_intersection/audit/README.md @@ -0,0 +1,23 @@ +#### Functionals + +##### Try and run the application. + +###### Can you see some kind of object that represents vehicles? + +##### Try and run the application. + +###### Are vehicles kept in there own lane? + +#### General + +###### When ever vehicles crash with other vehicles, does the program give some kind of feedback telling so? + +###### Does vehicles present at least two different velocities? (ex: 1 and 2. 0 does not count)? + +###### Do vehicles collide while waiting for the green light? + +#### Bonus + +###### +Is there any type of animation for traffic light? + +###### +Did the student implement some kind of movement animation for the vehicle? From 8b94b5387cf4fb06378614f46d7056fb2f9ce5a5 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 21 Jan 2021 13:01:10 +0000 Subject: [PATCH 02/11] audits --- subjects/road_intersection/README.md | 15 +++++++++------ subjects/road_intersection/audit/README.md | 12 ++++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index 52a6cfba..a494e1b0 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -36,8 +36,8 @@ _______________________ | ____________________ | ↓ | | ``` -There are 4 incoming lanes. Each lane has a set of consecutive unique ids `(ri, ri, ri)` where `(i = 0, 1, ⋯, 11)`, numbered in clockwise starting from the top-most. Each set of ids -indicates the outgoing direction of a vehicles. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. +There are 4 incoming lanes. Each lane has a set of consecutive unique ids `(ri, ri, ri)` where `(i = 0, 1, ⋯, 11)`, numbered clockwise starting from the top-most. Each set of ids ++indicates the outgoing direction of a vehicle. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. For this raid you must follow these assumptions: @@ -49,18 +49,21 @@ For this raid you must follow these assumptions: - Vehicles can have different velocities, it is up to you to decide the velocity for each vehicle but it must be at least two different velocities (0 does not count as a velocity for the vehicle). -- Vehicles should not collide in a traffic lane it should be kept a safety distance from other vehicles +- Vehicles should not collide in a traffic lane. It should be kept a safety distance from other vehicles + +- Vehicles should be generated randomly, both route and lane should be also random. #### **Stop conditions** -Has you know vehicles must not collide, if so you must show some kind of feedback (logs, terminal display or canvas display its up to you to decide) so that the users can conclude -that the vehicles collided. Each lane will have a traffic light system (either imaginary of real), the objective is that each vehicle stops if there is any type of collision with other vehicles. Otherwise the vehicles can proceed in their lane. +As you know vehicles must not collide, but for **debugging and testing** reasons you must show some kind of feedback (logs, terminal display or canvas display its up to you to decide) +if vehicles collide, so that the users can conclude that the vehicles collided. +Each lane will have a traffic light system (either imaginary of real), the objective is that each vehicle stops if there is any type of collision with other vehicles. Otherwise the vehicles can proceed in their lane. You are free to decide what algorithm you want to implement for the traffic light system, but keep in mind that traffic congestion should not be to high. ### Example -You can see some examples [here](TODO : link to the gifts). +You can see some examples [here](TODO : link to the gifs). ### Optional diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md index 596628a5..632c2618 100644 --- a/subjects/road_intersection/audit/README.md +++ b/subjects/road_intersection/audit/README.md @@ -6,15 +6,23 @@ ##### Try and run the application. -###### Are vehicles kept in there own lane? +###### Are vehicles kept in their own lane? + +##### Try and run the application, keeping it running for a while. + +###### Is there a low traffic congestion while running the application? #### General +###### Are vehicles generated randomly? (**random routes and lanes**) + ###### When ever vehicles crash with other vehicles, does the program give some kind of feedback telling so? ###### Does vehicles present at least two different velocities? (ex: 1 and 2. 0 does not count)? -###### Do vehicles collide while waiting for the green light? +###### Do vehicles not collide while waiting for the green light? + +###### Are vehicles assigned to their own route, and if so do they obey that route? (ex: r0 must turn left, r2 must turn right) #### Bonus From ff9d5c3cdd971c3b8fbd25a7ee854856df21607f Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 21 Jan 2021 14:39:35 +0000 Subject: [PATCH 03/11] adding: link to assets in subject --- subjects/road_intersection/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index a494e1b0..b0eb7382 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -73,7 +73,8 @@ You can implement the following optional features : - Vehicle movement animation. You can find some cool assets : - [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). - - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/) + - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/). + - [spriters-resource](https://www.spriters-resource.com/). ### Notions From 465beeb7ebf404951f54bca76609efb365aab6d9 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 21 Jan 2021 18:17:31 +0000 Subject: [PATCH 04/11] last fixs --- subjects/road_intersection/README.md | 4 ++-- subjects/road_intersection/audit/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index b0eb7382..19745b1f 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -2,7 +2,7 @@ ### Objectives -The objective of this raid is to create a traffic control strategy and represent it with an interface/UI. +The objective for this raid is to create a traffic control strategy and represent it with an interface/UI. Its up to you to decide which library and file system you want do use to create this simulation, but we recommend to use the library [sdl2](https://docs.rs/sdl2/0.34.3/sdl2/) ### Instructions @@ -37,7 +37,7 @@ _______________________ | ____________________ ``` There are 4 incoming lanes. Each lane has a set of consecutive unique ids `(ri, ri, ri)` where `(i = 0, 1, ⋯, 11)`, numbered clockwise starting from the top-most. Each set of ids -+indicates the outgoing direction of a vehicle. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. +indicates the outgoing direction of a vehicle. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. For this raid you must follow these assumptions: diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md index 632c2618..56038186 100644 --- a/subjects/road_intersection/audit/README.md +++ b/subjects/road_intersection/audit/README.md @@ -10,14 +10,12 @@ ##### Try and run the application, keeping it running for a while. -###### Is there a low traffic congestion while running the application? +###### Is there a low traffic congestion while running the application? (ex: traffic lane of 8 or more vehicles) #### General ###### Are vehicles generated randomly? (**random routes and lanes**) -###### When ever vehicles crash with other vehicles, does the program give some kind of feedback telling so? - ###### Does vehicles present at least two different velocities? (ex: 1 and 2. 0 does not count)? ###### Do vehicles not collide while waiting for the green light? @@ -29,3 +27,5 @@ ###### +Is there any type of animation for traffic light? ###### +Did the student implement some kind of movement animation for the vehicle? + +###### +When ever vehicles crash with other vehicles, does the program give some kind of feedback telling so? From bfacf6ec83c8687fc8c41e80636b616f3520e8e1 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 22 Jan 2021 15:47:54 +0000 Subject: [PATCH 05/11] rust exercise: inv_pyramid --- subjects/inv_pyramid/README.md | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 subjects/inv_pyramid/README.md diff --git a/subjects/inv_pyramid/README.md b/subjects/inv_pyramid/README.md new file mode 100644 index 00000000..c5105286 --- /dev/null +++ b/subjects/inv_pyramid/README.md @@ -0,0 +1,91 @@ +## inv_pyramid + +### Instructions + +Create a function called `inv_pyramid` that takes a `string` as an `integer` and returns a vector of `string`s. +This function should create a pyramid structure. Each element of the vector must be a combination of spaces and the string given + +### Example + +i = 5 + +```console +[ + " >", + " >>", + " >>>", + " >>>>", + " >>>>>", + " >>>>", + " >>>", + " >>", + " >" +] +``` + +### Expected Functions + +```rust +fn inv_pyramid(v: &str, i: u32) -> Vec<&str> {} +``` + +### Usage + +Here is a program to test your function + +```rust +fn main() { + let a = inv_pyramid(String::from("#"), 1); + let b = inv_pyramid(String::from("a"), 2); + let c = inv_pyramid(String::from(">"), 5); + let d = inv_pyramid(String::from("&"), 8); + + for v in a.iter() { + println!("{:?}", v); + } + for v in b.iter() { + println!("{:?}", v); + } + for v in c.iter() { + println!("{:?}", v); + } + for v in d.iter() { + println!("{:?}", v); + } +} +``` + +And its output + +```console +student@ubuntu:~/[[ROOT]]/test$ cargo run +" #" +" a" +" aa" +" a" +" >" +" >>" +" >>>" +" >>>>" +" >>>>>" +" >>>>" +" >>>" +" >>" +" >" +" &" +" &&" +" &&&" +" &&&&" +" &&&&&" +" &&&&&&" +" &&&&&&&" +" &&&&&&&&" +" &&&&&&&" +" &&&&&&" +" &&&&&" +" &&&&" +" &&&" +" &&" +" &" +student@ubuntu:~/[[ROOT]]/test$ +``` From 770c1dc9a5cddad3ebd01a7ba0c4631bf8656adb Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 22 Jan 2021 18:17:52 +0000 Subject: [PATCH 06/11] rust exercuse: scytale_cipher --- subjects/scytale_cipher/README.md | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 subjects/scytale_cipher/README.md diff --git a/subjects/scytale_cipher/README.md b/subjects/scytale_cipher/README.md new file mode 100644 index 00000000..c82ca4dc --- /dev/null +++ b/subjects/scytale_cipher/README.md @@ -0,0 +1,68 @@ +## scytale_cipher + +### Instructions + +Create a function called `scytale_cipher` that takes a `string` and an `integer` and returns a `string`. +This function should create a scytale cipher also known as spartan cipher. In practice its a cylinder with a +strip strapped around it on which is written a message, when removed the strip the message is coded. +Depending on the size of the cylinder the message would change. So the only way to decipher the coded message is +by using a cylinder of the same size. + +You function should recreate the scytale cipher, the string being the message and the size being the number of +straps in the cylinder. + +### Example + +message : "scytale Code" +size : 6 + +```console +['s', 'e'] +['c', ' '] +['y', 'C'] +['t', 'o'] +['a', 'd'] +['l', 'e'] +``` + +output : sec yCtoadle +size : 8 + +```console +['s', 'C'] +['c', 'o'] +['y', 'd'] +['t', 'e'] +['a', ' '] +['l', ' '] +['e', ' '] +[' ', ' '] +``` + +output : sCcoydtea l e + +### Expected Functions + +```rust +fn scytale_cipher(message: String, i: u32) -> String {} +``` + +### Usage + +Here is a program to test your function + +```rust +fn main() { + println!("\"scytale Code\" size=6 -> {:?}", scytale_cipher(String::from("scytale Code"), 6))); + println!("\"scytale Code\" size=8 -> {:?}", scytale_cipher(String::from("scytale Code"), 8))); +} +``` + +And its output + +```console +student@ubuntu:~/[[ROOT]]/test$ cargo run +"scytale Code" size=6 -> "sec yCtoadle" +"scytale Code" size=8 -> "sCcoydtea l e" +student@ubuntu:~/[[ROOT]]/test$ +``` From 57d169bb1b1f2a44d1d46db1e763b9af02ee643c Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 27 Jan 2021 14:01:09 +0000 Subject: [PATCH 07/11] adding : brackets_matching subject --- subjects/brackets_matching/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 subjects/brackets_matching/README.md diff --git a/subjects/brackets_matching/README.md b/subjects/brackets_matching/README.md new file mode 100644 index 00000000..b152bbc2 --- /dev/null +++ b/subjects/brackets_matching/README.md @@ -0,0 +1,25 @@ +## brackets_matching + +### Instructions + +Write a program that takes an undefined number of `string` in arguments. For each argument, if the expression is correctly bracketed, the program prints on the standard output `OK` followed by a newline (`'\n'`), otherwise it prints `Error` followed by a newline. + +Symbols considered as brackets are parentheses `(` and `)`, square brackets `[` and `]` and curly braces `{` and `}`. Every other symbols are simply ignored. + +An opening bracket must always be closed by the good closing bracket in the correct order. A `string` which does not contain any bracket is considered as a correctly bracketed `string`. + +If there is no argument, the program must print nothing. + +### Usage + +```console +student@ubuntu:~/[[ROOT]]/brackets$ ./brackets '(johndoe)' | cat -e +OK$ +student@ubuntu:~/[[ROOT]]/brackets$ ./brackets '([)]' | cat -e +Error$ +student@ubuntu:~/[[ROOT]]/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e +OK$ +OK$ +student@ubuntu:~/[[ROOT]]/brackets$ ./brackets +student@ubuntu:~/[[ROOT]]/brackets$ +``` From 90c50318a21d3615a152e42b0a5b1f0c1e7226d9 Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 2 Feb 2021 21:08:36 +0000 Subject: [PATCH 08/11] adding link to example --- subjects/road_intersection/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index 19745b1f..8fce3cb4 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -63,7 +63,7 @@ You are free to decide what algorithm you want to implement for the traffic ligh ### Example -You can see some examples [here](TODO : link to the gifs). +You can see an example [here](https://youtu.be/pC79E0fdzYo). ### Optional @@ -72,6 +72,7 @@ You can implement the following optional features : - A visualization of the traffic light, for example: a line that changes color from `Red` to `Green`. - Vehicle movement animation. You can find some cool assets : + - [limezu](https://limezu.itch.io/) - [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/). - [spriters-resource](https://www.spriters-resource.com/). From 087b402c760eb7392e363209aeaa8d4934110a08 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 5 Feb 2021 13:40:28 +0000 Subject: [PATCH 09/11] subject update --- subjects/road_intersection/README.md | 123 +++++++++++++++++---------- 1 file changed, 79 insertions(+), 44 deletions(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index 8fce3cb4..57451521 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -7,71 +7,106 @@ Its up to you to decide which library and file system you want do use to create ### Instructions -There exists various shapes of intersections, we will focus on the widely seen four-lane intersection. For simplicity each lane will have two directions +#### **Environment and Rules** + +You must create an environment which contains all the objects described in this section. You can display the objects as you wish. + +1. Roads + +There exists various shapes of intersections, we will focus on the widely seen four-lane intersection. For simplicity each lane will have two directions. ```console - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | ↑ | - | | ↑ | - |r0 r1 r2 | | -_______________________| ← ↓ → | |___________________ - | ↑ r3 - ← ← ← ← ← ← | ← r4 ← ← ← ← ← - | ↓ r5 -_________________________________|______________________________ - r11 ↑ | - → → → → → → r10 → | → → → → → → - r9 ↓ | -_______________________ | ____________________ - | | ← ↑ → | - | ↓ |r8 r7 r6 | - | ↓ | | - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | ↑ | - | ↓ | | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + |r0 r1 r2 | ↑ | +_______________| ← ↓ → | ↑ |_____________ + | ↑ r0 +← ← ← ← ← ← ← | ← r1 ← ← ← ← ← + | ↓ r2 +_________________________|_______________________ + r2 ↑ | + → → → → → r1 → | → → → → → → + r0 ↓ | +_______________ | _____________ + | | ← ↑ → | + | ↓ |r2 r1 r0 | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | + | ↓ | ↑ | ``` -There are 4 incoming lanes. Each lane has a set of consecutive unique ids `(ri, ri, ri)` where `(i = 0, 1, ⋯, 11)`, numbered clockwise starting from the top-most. Each set of ids -indicates the outgoing direction of a vehicle. Vehicles driving in a given lane will have a given **route** (r0 | r1 .... r11) that indicates the lane destination of that vehicles. +For clarification reasons we will assume that a lane can have three different routes (consider you are in the vehicle position): + +- `r0`, turning right +- `r1`, straight ahead +- `r2`, turning left + +2. Traffic lights -For this raid you must follow these assumptions: +Traffic lights are signalling devices positioned at road intersections that follows an universal color code, +normally its green, red and amber, but for this project you will just use the colors **red** and **green**. -- Vehicles are to be **autonomous**, so Vehicles driving on a lane with a **given route** must follow the direction of that route, its not possible for the - driver to change lane. +You will then have to create some kind of representation for the traffic lights and distribute them for each lane in the intersection. -- Other traffic units such as pedestrians and emergency vehicles are not considered. +You are free to decide what algorithm you want to implement for the traffic light system, but keep in mind that traffic congestion should not be to high. -- Vehicles can have different velocities, it is up to you to decide the velocity for each vehicle but it must be at least two different - velocities (0 does not count as a velocity for the vehicle). +3. Vehicles -- Vehicles should not collide in a traffic lane. It should be kept a safety distance from other vehicles +``` + ______ + /|_||_\`.__ +=`-(_)--(_)-' +``` -- Vehicles should be generated randomly, both route and lane should be also random. +Vehicles must obey this rules: -#### **Stop conditions** +- Autonomous, vehicles driving on a lane with a **given route** must +follow the direction of that route, its not possible for the driver to change lanes or route. -As you know vehicles must not collide, but for **debugging and testing** reasons you must show some kind of feedback (logs, terminal display or canvas display its up to you to decide) -if vehicles collide, so that the users can conclude that the vehicles collided. -Each lane will have a traffic light system (either imaginary of real), the objective is that each vehicle stops if there is any type of collision with other vehicles. Otherwise the vehicles can proceed in their lane. +- Each vehicle must have a fixed velocity. -You are free to decide what algorithm you want to implement for the traffic light system, but keep in mind that traffic congestion should not be to high. +- It must be kept a safety distance from other vehicles, if one vehicle stops the other vehicle thats +behind him must stop and keep its distance. + +- Vehicles must stop if the traffic light is red and proceed otherwise. + +- Vehicles must have different routes, either `r0`, `r1` or `r2`. + +- Other vehicles such as emergency vehicles are not considered. + +--- + +#### **Commands** + +The generating of vehicle must be done using the keyboard event. You must be able to generate +vehicles in different lanes and with different routes. + +For this it must be possible to do the following: + +- The `Arrow` keys must generate one vehicle in a specific direction and with a random route ( `r0`, `r1` and `r2`): + - `Up` south to north. + - `Down` north to south. + - `Right` west to east. + - `Left` east to west. + +- The `R` key must generate random vehicles with random lanes and routes. + +- The `Esc` key must finish the simulation. ### Example You can see an example [here](https://youtu.be/pC79E0fdzYo). -### Optional +### Bonus You can implement the following optional features : -- A visualization of the traffic light, for example: a line that changes color from `Red` to `Green`. - -- Vehicle movement animation. You can find some cool assets : +- Vehicle and traffic lights animation. You can find some cool assets : - [limezu](https://limezu.itch.io/) - [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/). From 37e11c2033a6c23d0107a3fe172be421f477abb1 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 5 Feb 2021 15:31:41 +0000 Subject: [PATCH 10/11] audit update --- subjects/road_intersection/README.md | 4 +- subjects/road_intersection/audit/README.md | 82 ++++++++++++++++++---- 2 files changed, 72 insertions(+), 14 deletions(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index 57451521..d89444f1 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -98,6 +98,8 @@ For this it must be possible to do the following: - The `Esc` key must finish the simulation. +> Arrow keys must not let the user spam the creation of vehicles, vehicles must be created with a safe distance between them. + ### Example You can see an example [here](https://youtu.be/pC79E0fdzYo). @@ -106,7 +108,7 @@ You can see an example [here](https://youtu.be/pC79E0fdzYo). You can implement the following optional features : -- Vehicle and traffic lights animation. You can find some cool assets : +- Vehicle and traffic lights animation and image rendering. You can find some cool assets : - [limezu](https://limezu.itch.io/) - [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). - [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/). diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md index 56038186..a30116d9 100644 --- a/subjects/road_intersection/audit/README.md +++ b/subjects/road_intersection/audit/README.md @@ -1,31 +1,87 @@ #### Functionals -##### Try and run the application. +##### Try and run the application, then generate a vehicle by pressing the `"Arrow Up"` key. -###### Can you see some kind of object that represents vehicles? +###### Was a vehicle generated from the cardinal south? -##### Try and run the application. +##### Try pressing the `"Arrow Down"` key. -###### Are vehicles kept in their own lane? +###### Was a vehicle generated from the cardinal North? -##### Try and run the application, keeping it running for a while. +##### Try pressing the `"Arrow Right"` key. -###### Is there a low traffic congestion while running the application? (ex: traffic lane of 8 or more vehicles) +###### Was a vehicle generated from the cardinal west? -#### General +##### Try pressing the `"Arrow left"` key. + +###### Was a vehicle generated from the cardinal east? + +##### Try pressing the `"R"` key. + +###### Are vehicles generated randomly(random lane and route)? + +##### Try to generate tree vehicles in the same lane (do this to all lanes). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Down"` key (to this at least 3 times). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate two vehicles at the same time, one using the `"Right"` key and the other using the `"Left"` key (to this at least 3 times). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Left"` key (to this at least 3 times). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Right"` key (to this at least 3 times). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate two vehicles at the same time, one using the `"Down"` key and the other using the `"Left"` key (to this at least 3 times). -###### Are vehicles generated randomly? (**random routes and lanes**) +###### Did all vehicles passed the intersection safely? -###### Does vehicles present at least two different velocities? (ex: 1 and 2. 0 does not count)? +##### Try to generate two vehicles at the same time, one using the `"Down"` key and the other using the `"Right"` key (to this at least 3 times). -###### Do vehicles not collide while waiting for the green light? +###### Did all vehicles passed the intersection safely? + +##### Try to generate five vehicles using the `"Up"` key, at the same time generate two vehicles using the key `"Right"`. + +###### Did all vehicles passed the intersection safely? + +##### Try to generate one vehicle for all the lanes (to this at least 3 times). + +###### Did all vehicles passed the intersection safely? + +##### Try to generate vehicles randomly using the `"R"` key. Then wait for at least 1 min. + +###### Did all vehicles passed the intersection safely? + +###### Was there a low traffic congestion while running the application? (ex: high traffic congestion can be 8 or more vehicles in the same lane without proceeding)? + +##### Try to generate vehicles with lanes at your choice. + +###### Did all vehicles passed the intersection safely? + +#### General + +###### Is it not possible to spam the creation of vehicles(by pressing the arrow keys to many times)? ###### Are vehicles assigned to their own route, and if so do they obey that route? (ex: r0 must turn left, r2 must turn right) +###### Are vehicles kept in a safe distance(do not collide when ever one stops)? + +###### Do vehicles stop when ever there is a red light? + +###### Do vehicles proceed when ever there is a green light? + #### Bonus -###### +Is there any type of animation for traffic light? +###### +Is there any type of image sprite for traffic light? -###### +Did the student implement some kind of movement animation for the vehicle? +###### +Did the student implement some kind of animation and image sprite for the vehicle? -###### +When ever vehicles crash with other vehicles, does the program give some kind of feedback telling so? +###### +Did the student implement more features than those in the subject? From 21622093b5f2fb6204323f133763554f04bc60d0 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 5 Feb 2021 17:37:19 +0000 Subject: [PATCH 11/11] correction from feedback given --- subjects/road_intersection/README.md | 34 ++++++++++++---------- subjects/road_intersection/audit/README.md | 24 +++++++-------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index d89444f1..b666d00d 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -21,18 +21,18 @@ There exists various shapes of intersections, we will focus on the widely seen f | ↓ | ↑ | | ↓ | ↑ | | ↓ | ↑ | - |r0 r1 r2 | ↑ | + | r s l | ↑ | _______________| ← ↓ → | ↑ |_____________ - | ↑ r0 -← ← ← ← ← ← ← | ← r1 ← ← ← ← ← - | ↓ r2 + | ↑ r +← ← ← ← ← ← ← | ← s ← ← ← ← ← + | ↓ l _________________________|_______________________ - r2 ↑ | - → → → → → r1 → | → → → → → → - r0 ↓ | + l ↑ | + → → → → → s → | → → → → → → + r ↓ | _______________ | _____________ | | ← ↑ → | - | ↓ |r2 r1 r0 | + | ↓ | r s l | | ↓ | ↑ | | ↓ | ↑ | | ↓ | ↑ | @@ -42,9 +42,9 @@ _______________ | _____________ For clarification reasons we will assume that a lane can have three different routes (consider you are in the vehicle position): -- `r0`, turning right -- `r1`, straight ahead -- `r2`, turning left +- `r`, turning right +- `s`, straight ahead +- `l`, turning left 2. Traffic lights @@ -65,17 +65,19 @@ You are free to decide what algorithm you want to implement for the traffic ligh Vehicles must obey this rules: -- Autonomous, vehicles driving on a lane with a **given route** must -follow the direction of that route, its not possible for the driver to change lanes or route. +- Vehicles must have a color depending on their route the colors are up to you to decide(ex:`r`- purple, `s`- Blue and `l`- Yellow). This must then be given during the audit + +- Autonomous, vehicles driving on a lane with a **given route** must follow the direction of +that route, its not possible for the driver to change lanes or route. - Each vehicle must have a fixed velocity. -- It must be kept a safety distance from other vehicles, if one vehicle stops the other vehicle thats +- It must be kept a safety distance from other vehicles, if one vehicle stops the other vehicle thats behind him must stop and keep its distance. - Vehicles must stop if the traffic light is red and proceed otherwise. -- Vehicles must have different routes, either `r0`, `r1` or `r2`. +- Vehicles must have different routes, either `r`, `s` or `l`. - Other vehicles such as emergency vehicles are not considered. @@ -88,7 +90,7 @@ vehicles in different lanes and with different routes. For this it must be possible to do the following: -- The `Arrow` keys must generate one vehicle in a specific direction and with a random route ( `r0`, `r1` and `r2`): +- The `Arrow` keys must generate one vehicle in a specific direction and with a random route ( `r`, `s` and `l`): - `Up` south to north. - `Down` north to south. - `Right` west to east. diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md index a30116d9..a3fcdf33 100644 --- a/subjects/road_intersection/audit/README.md +++ b/subjects/road_intersection/audit/README.md @@ -22,55 +22,55 @@ ##### Try to generate tree vehicles in the same lane (do this to all lanes). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Down"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Right"` key and the other using the `"Left"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Left"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Up"` key and the other using the `"Right"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Down"` key and the other using the `"Left"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate two vehicles at the same time, one using the `"Down"` key and the other using the `"Right"` key (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate five vehicles using the `"Up"` key, at the same time generate two vehicles using the key `"Right"`. -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate one vehicle for all the lanes (to this at least 3 times). -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ##### Try to generate vehicles randomly using the `"R"` key. Then wait for at least 1 min. -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? ###### Was there a low traffic congestion while running the application? (ex: high traffic congestion can be 8 or more vehicles in the same lane without proceeding)? ##### Try to generate vehicles with lanes at your choice. -###### Did all vehicles passed the intersection safely? +###### Did all vehicles passed the intersection without any collision? #### General ###### Is it not possible to spam the creation of vehicles(by pressing the arrow keys to many times)? -###### Are vehicles assigned to their own route, and if so do they obey that route? (ex: r0 must turn left, r2 must turn right) +###### Are vehicles assigned to their own route, and if so do they obey that route? (you can use the colors for each route to see this) ###### Are vehicles kept in a safe distance(do not collide when ever one stops)?