-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path5-weekday.arl
More file actions
35 lines (29 loc) · 1.51 KB
/
5-weekday.arl
File metadata and controls
35 lines (29 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
archetype weekday
variable n : int = 0
entry weekday (d : date) {
///////////////////////////////////////////////////////////////////
// //
// FIXME: compute weekday for d date and assign this value to n //
// weekday takes a date d and returns: //
// 0 if sunday //
// 1 if monday //
// 2 if tuesday //
// 3 if wednesday //
// 4 if thursday //
// 5 if friday //
// 6 if saturday //
// hint: use arithmetic operators with duration //
// //
///////////////////////////////////////////////////////////////////
}
// Solution at the following address:
// https://completium.com/docs/contract/tuto/archetype-datearith
// (ctrl+click to follow link)
// Commands to DEPLOY contract (in Terminal window below):
// cd tutorial
// completium-cli deploy 5-weekday.arl
// Command to CALL the contract (in Terminal window below):
// completium-cli call 5-weekday --arg '{ "d" : "2008-11-28" }'
// Command to VIEW the contract in BETTER CALL DEV
// (ctrl+click the generated URL)
// completium-cli show contract 5-weekday