• Nat (she/they)
    link
    fedilink
    13
    edit-2
    4 days ago

    PR: support polyamory

    This also changes the API to take a shared reference rather than ownership of the lovers :3

    pub fn lovers(partners: &[&dyn Gender]) {
        println!("smooch~");
    }
    

    Oh and while we’re at it, for our agender users:

    impl Gender for () {}
    
    • @tuna@discuss.tchncs.de
      link
      fedilink
      64 days ago

      PR: Merged

      Good call with using a shared reference so now we can kiss our partner(s) more than once!!

      Kissing many partners with one big smooch might be hard tho, maybe we need to change the implementation to use combinatorics so that everyone kisses each of their partners at least once.

      Since there’s no way to tell who kisses who, i can cheat by printing nCr times :3

      pub fn lovers(partners: &[&dyn Gender]) {
          match partners.len() {
              0 => {
                  println!("ghost smooch~");
              }
              1 => {
                  println!("mirror smooch~");
              }
              p => {
                  // p >= 2, safe to unwrap
                  for _ in 0..ncr(p, 2).unwrap() {
                      println!("smooch~");
                  }
              }
          }
      }