==- Equals!=- Not Equals<- Less Than>- Greater Than<=- Less Than or Equals>=- Greater Than or Equals
CursorScript uses logical gates with short-circuiting:
&&- AND||- OR!- NOT (Unary)
if (score > 10 && gameOver == false) {
print("Keep playing!");
} else {
print("Game Over");
}
let i = 0;
while (i < 10) {
if (i == 5) break;
if (i % 2 == 0) {
i = i + 1;
continue;
}
print(i)
i = i + 1
}
break- Exits the current loop immediately.continue- Skips the rest of the current loop iteration and moves to the next check.
Asynchronous operations are handled using async functions and the await keyword.
async fn main() {
const (res, err) = await someAsyncTask();
if (!err) print(res);
}