We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19dfbff commit 0cc7badCopy full SHA for 0cc7bad
dana/programs/calculator.dana
@@ -1,6 +1,7 @@
1
-(* calculator.dana *)
+(* A line calculator *)
2
+
3
def main
- # Helper Function
4
+ # Helper Functions
5
6
def is_digit is byte: c as byte
7
if '0' <= c and c <= '9': return: true
@@ -38,7 +39,7 @@ def main
38
39
# Any other characters among them get ignored.
40
#
41
# Output: lines with the results
- # or a message "Invalid" in case of failure
42
+ # or a message "Invalid" in case of failure(s)
43
44
var buf is byte[256]
45
var idx len start p_end a b is int
dana/programs/calculator.input
@@ -5,7 +5,3 @@
25 + 10
10 * 3 dsfdfadf
asdf 5sdf -adfd2
8
-5-
9
-35+
10
-+7
11
-2345 _ 2342
dana/programs/calculator.result
35
30
-Invalid
0 commit comments