Discrete math

Table of Contents

1 Lectures

2 Labs

3 Homeworks

  • 20
  • 56
  • 121, 149
  • 226, 232
  • 183 — quine in Rust

    fn main() {
        let (s1, s2) = ("fn main() {\n    let (s1, s2) = (", ");\n    print!(\"{}{:?}, {:?}{}\", s1, s1, s2, s2);\n}\n");
        print!("{}{:?}, {:?}{}", s1, s1, s2, s2);
    }
    
  • 184 – 172 in Nim

    import strutils
    proc p1() =
      let flag = true
      let (s1, s2, s3, s4, s5) = ("import strutils\x0Aproc p", "() =\x0A  let flag = ", "\x0A  let (s1, s2, s3, s4, s5) = (", ")\x0A  echo s1 & (if flag: \"2\" else: \"1\") & s2 & (if flag: \"false\" else: \"true\") & s3 & escape(s1) & \", \"  & escape(s2) & \", \" & escape(s3) & \", \" & escape(s4) & \", \" & escape(s5) & s4 & (if flag: \"2\" else: \"1\") & s5\x0Ap", "()")
      echo s1 & (if flag: "2" else: "1") & s2 & (if flag: "false" else: "true") & s3 & escape(s1) & ", "  & escape(s2) & ", " & escape(s3) & ", " & escape(s4) & ", " & escape(s5) & s4 & (if flag: "2" else: "1") & s5
    p1()
    
    import strutils
    proc p2() =
      let flag = false
      let (s1, s2, s3, s4, s5) = ("import strutils\x0Aproc p", "() =\x0A  let flag = ", "\x0A  let (s1, s2, s3, s4, s5) = (", ")\x0A  echo s1 & (if flag: \"2\" else: \"1\") & s2 & (if flag: \"false\" else: \"true\") & s3 & escape(s1) & \", \"  & escape(s2) & \", \" & escape(s3) & \", \" & escape(s4) & \", \" & escape(s5) & s4 & (if flag: \"2\" else: \"1\") & s5\x0Ap", "()")
      echo s1 & (if flag: "2" else: "1") & s2 & (if flag: "false" else: "true") & s3 & escape(s1) & ", "  & escape(s2) & ", " & escape(s3) & ", " & escape(s4) & ", " & escape(s5) & s4 & (if flag: "2" else: "1") & s5
    p2()
    

Unchecked:


Home Page
Conspects Home Page