修改默认程序
// Create a simple Counter actor. actor Counter { stable var currentValue : Nat = 0; // Increment the counter with the increment function. public func increment() : async () { currentValue += 1; }; // Read the counter value with a get function. public query func get() : async Nat { currentValue }; // Write an arbitrary value with a set function. public func set(n: Nat) : async () { currentValue := n; }; }
最后更新于