about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_grade_comparison.txt
blob: 39df2f881f6aa75d1c7dbe8a4c8cbb4ac693e1ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Test grade function with comparison patterns */
grade : score -> 
  when score is
    score >= 90 then "A"
    score >= 80 then "B"
    score >= 70 then "C"
    _  then "F";

result1 : grade 95;
result2 : grade 85;
result3 : grade 65;

..out result1;
..out result2;
..out result3;