Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module 0x1::Counter {
resource struct Counter { value: u64 }
public fun create(): Counter {
Counter { value: 0 }
}
public fun increment(counter: &mut Counter) {
counter.value = counter.value + 1
}
public fun reset(counter: &mut Counter) {
counter.value = 0
}
}Coding works best on desktop or with an external keyboard.