diff --git a/exercises/simulator/simulator.rs b/exercises/simulator/simulator.rs new file mode 100644 index 00000000..5e9440ec --- /dev/null +++ b/exercises/simulator/simulator.rs @@ -0,0 +1,40 @@ +enum IPAddrKind { + V4(u8, u8, u8, u8), + V6(String), +} + +enum MacAddrKind { + PHYSICAL(u64), + VIRTUAL(u32), +} + +enum DeviceType { + Desktop(IPAddrKind), + Server(IPAddrKind), + Switch(MacAddrKind), + Router(MacAddrKind), +} + +struct Device { + dtype: DeviceType, + name: String, +} + +fn main() { + // create a hashmap of pairs + // "Desk1" [Desktop, V4] get connected to "Switch2", "Router1" [Router, Virtual] + // "Desk2" [Desktop, V6] get connected to "Switch1", "Router1" + // "Desk3" [Desktop, V4] get connected to "Server1" [Server, V4] + // "Switch1" [Switch, PHYSICAL] get connected to "Router1" + // "Switch2" [Switch, PHYSICAL] get connected to "Router2" [Router, Virtual] + // "Server2" [Server, V6] get connected to "Router2" + // Note: connections are suppose to be bidirectional, so write your methods in a way so that they would automatically handled + + // Given a device name, return who are connected to it + + // Given an IPAddrKind, return devices ip addresses who uses specific IPAddrKind + + // Given Device1 and Device2, return true, if they are connected (including through other nodes) + + // Given a device name, remove it from all of its connection +} diff --git a/exercises/students/students.rs b/exercises/students/students.rs index 8cd68ef3..e5039584 100644 --- a/exercises/students/students.rs +++ b/exercises/students/students.rs @@ -24,7 +24,7 @@ fn main() { // an instance of student (Michael Dodge, 1066, Bio, 2023) - // Note: shorthand possible for Rob and Michael; Adam and Helex + // Note: shorthand possible for Rob and Michael; Adam and Nick // call a function that will return list of students graduating by year diff --git a/info.toml b/info.toml index 6dc88751..36cb78e6 100644 --- a/info.toml +++ b/info.toml @@ -1059,4 +1059,10 @@ hint = "" name = "students" path = "exercises/students/students.rs" mode = "compile" +hint = "" + +[[exercises]] +name = "simulator" +path = "exercises/simulator/simulator.rs" +mode = "compile" hint = "" \ No newline at end of file