Skip to content

Commit 7013c15

Browse files
committed
FEAT: simple calculator app.
1 parent b13dda4 commit 7013c15

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Showcase/calculator.red

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Red [
2+
Title: "Calculator demo"
3+
Author: "Nick Antonaccio"
4+
File: %calculator.red
5+
License: "Public domain"
6+
Needs: 'View
7+
Notes: "Very simple calculator app. More from Nick at http://redprogramming.com"
8+
]
9+
10+
view [
11+
title "Calculator"
12+
f: field 230x50 font-size 25 "" return
13+
style b: button 50x50 bold font-size 18 [append f/text face/text]
14+
b "1" b "2" b "3" b " + " return
15+
b "4" b "5" b "6" b " - " return
16+
b "7" b "8" b "9" b " * " return
17+
b "0" b "." b " / " b "=" [
18+
attempt [
19+
calculation: form do f/text
20+
append clear f/text calculation
21+
]
22+
]
23+
]

0 commit comments

Comments
 (0)