Good vs. Evil

Discussion in 'Forum Games' started by Randomguy404, Oct 12, 2014.

  1. duckfan77

    duckfan77 Well-Known Member

    21 Think I did well on the midterm! Didn't get to the bonus problem, but the rest I feel good on.
     
  2. MrMonsterGuy18

    MrMonsterGuy18 Well-Known Member

    20 Finally got my password reset, now I’m back (again)
     
    GamerwithnoGame likes this.
  3. lenscas

    lenscas Over-Achiever

    21 I managed to work on Arena_keeper a bit more.

    Module system is now almost done. I only need to make sure that mods don't trample over each other and add 1 thing back in and its done. After that, I simply need to clean up the code and update the README and it can be merged.

    Working on this also caused me to discover something new about rust's syntax, to do with enums and pattern matching.
    Code:
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(untagged)]
    enum Tile {
      BaseTile {
      image: String,
      end: f64,
      baseSpeed: f64,
      },
      ExtendingTile {
      end: f64,
      image: String,
      extend: TileType,
      baseSpeed: Option<f64>,
      },
    }
    impl Tile {
      pub fn get_end(&self) -> f64 {
      match &self {
      Tile::BaseTile { end, .. } | Tile::ExtendingTile { end, .. } => *end,
      }
      }
    }
    
    I already knew that entries in an enum could hold values. However, I always used that like this:
    Code:
    pub enum Example {
        NoValue,
        OneValue(f64),
        TwoValues(f64,i32)
    }
    
    But, today I learned that you can also basically use them like structs and that you can be selective about which fields you want out of them when pattern matching. This means that I only need one branch for every field that the two tile types share (like image, or end) in the above example.
     
  4. duckfan77

    duckfan77 Well-Known Member

    20 Welcome back MrMonster!
     
  5. lenscas

    lenscas Over-Achiever

    21 my desktop decided to not recognize its audio jacks any more.

    Luckily, my monitor is connected using HDMI and has a line out.

    So... now sound uses this path

    Desktop -> Monitor -> Server -> Amplifier -> Speaker
     
  6. duckfan77

    duckfan77 Well-Known Member

    20 welp. That's an interesting path.
     
  7. triggerfinger12

    triggerfinger12 Well-Known Member

    19. Oh, the problems of today xD
     
  8. GamerwithnoGame

    GamerwithnoGame Forum Addict

    20. I'll second that welcoming back of MrMonsterGuy!
     
    MrMonsterGuy18 likes this.
  9. MrMonsterGuy18

    MrMonsterGuy18 Well-Known Member

    19 Thanks you!
     
    GamerwithnoGame likes this.
  10. duckfan77

    duckfan77 Well-Known Member

  11. LordPINE

    LordPINE Well-Known Member

    19 I'll be the third one to welcome back MrMonsterGuy then. Welcome back dude, good to have you playing the forum games again.
     
    MrMonsterGuy18 likes this.
  12. duckfan77

    duckfan77 Well-Known Member

    18 Exam grades posted soon.
     
  13. lenscas

    lenscas Over-Achiever

    19 decided to push what I have for the module system to master.

    It should be on feature parity with the old generated code, however mods aren't name spaced and are thus able to trample over each other.

    The reason I decided to push is simple, a new GUI library appeared that seems actually rather nice, works on WASM AND it is render agnostic. Meaning that I rather look into that

    The library: https://github.com/hecrj/iced

    With that I may even be able to bring back the floating window style of the yew based version, if people like that.
     
  14. MrMonsterGuy18

    MrMonsterGuy18 Well-Known Member

    18 I took two test today. Didn’t do too hot on my biology test, but I’m pretty confident in my Algebra 2 test.
     
  15. GamerwithnoGame

    GamerwithnoGame Forum Addict

    19. I have a hankering for cake...
     
  16. duckfan77

    duckfan77 Well-Known Member

  17. GamerwithnoGame

    GamerwithnoGame Forum Addict

    19.5 I think the above should be 18.5, as no comments count for half points ;)
     
  18. duckfan77

    duckfan77 Well-Known Member

    18.5 Yeah, I messed up.
     
  19. triggerfinger12

    triggerfinger12 Well-Known Member

Share This Page