This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| switch food | |
| when "fish" then cook bake | |
| when "steak" then cook grill | |
| when "french fries" then cook fry | |
| when "sashimi" then cook none | |
| when "apple" | |
| if appleSeason is true | |
| cook none | |
| else | |
| cook bake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count, instrument, instruments, _i, _len; | |
| instruments = ["piano", "violin", "guitar", "flute", "drums"]; | |
| for (count = _i = 0, _len = instruments.length; _i < _len; count = ++_i) { | |
| instrument = instruments[count]; | |
| instrument_list(count + 1, instrument); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| instruments=["piano","violin","guitar","flute","drums"] | |
| instrument_list count+1,instrument for instrument,count in instruments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var instrument, instruments, _i, _len; | |
| instruments = ["piano", "violin", "guitar", "flute", "drums"]; | |
| for (_i = 0, _len = instruments.length; _i < _len; _i++) { | |
| instrument = instruments[_i]; | |
| if (instrument !== flute) { | |
| play(instrument); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| instruments=["piano","violin","guitar","flute","drums"] | |
| play instrument for instrument in instruments when instrument isnt flute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var instrument, _i, _len, _ref; | |
| _ref = ["piano", "violin", "guitar"]; | |
| for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
| instrument = _ref[_i]; | |
| play(instrument); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| play instrument for instrument in ["piano","violin","guitar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var umbrella; | |
| umbrella = raining ? "open" : "close"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| umbrella= if raining then "open" else "close" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var umbrella; | |
| if (raining) { | |
| umbrella = "open"; | |
| } |