!752 p{ makeBot("Unit converter bot"); } answer{ if(matchStart("* * to *", s, m)){ double num = Double.parseDouble(m.unq(0)); S from = m.unq(1); S to = m.unq(2); if(from == "c" && to == "f"){ Double result = (num * 1.8) + 32; ret "" + result; } if(from == "f" && to == "c"){ Double result = (num - 32) / 1.8; ret "" + result; } if(from == "m"){ if(to == "mm"){ Double result = num * 1000; ret "" + result; } if(to == "cm"){ Double result = num * 100; ret "" + result; } if(to == "dm"){ Double result = num * 10; ret "" + result; } if(to == "dam"){ Double result = num / 10; ret "" + result; } if(to == "hm"){ Double result = num / 100; ret "" + result; } if(to == "km"){ Double result = num / 1000; ret "" + result; } } } }