ZenScript main repository
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

conditionals.zs 1022B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. val ternaryOperation = true ? 100 : 222;
  2. println(ternaryOperation);
  3. var coalesce_one as string? = null;
  4. var coalesce_tow as string? = "test";
  5. var coalesce = coalesce_one ?? coalesce_tow;
  6. println(coalesce);
  7. //if(coalesce == "test123") {
  8. // println("true");
  9. //}
  10. if 1 == 1 {
  11. println("intCompareTrue");
  12. }
  13. //if(1 == "1") {
  14. // println("well...");
  15. //}
  16. if "1" == 1 {
  17. println("...");
  18. }
  19. //var coco as int? = 10;
  20. //var coal as int? = 1;
  21. //
  22. //println(coal ?? coco);
  23. println(".....");
  24. println(true ? "RR" : "TT");
  25. println((false && true && true) ? "true" : "false");
  26. println((true && true) ? "true" : "false");
  27. println((true && false) ? "true" : "false");
  28. println((false && false) ? "true" : "false");
  29. println("---");
  30. println((false || true) ? "true" : "false");
  31. println((true || true) ? "true" : "false");
  32. println((true || false) ? "true" : "false");
  33. println((false || false) ? "true" : "false");
  34. println(":::");
  35. println((1 <= 2) ? "true" : "false");