Skip to content

Added simple Counter in counter.py#698

Open
opencode-agent[bot] wants to merge 1 commit into
mainfrom
opencode/issue697-20260330053036
Open

Added simple Counter in counter.py#698
opencode-agent[bot] wants to merge 1 commit into
mainfrom
opencode/issue697-20260330053036

Conversation

@opencode-agent
Copy link
Copy Markdown

I added a new file at the repo root with a simple Counter class.

File: counter.py

  • Class: Counter
  • Methods:
    • increment(amount=1) -> int: increments the counter and returns the new value
    • decrement(amount=1) -> int: decrements the counter and returns the new value
    • get_value() -> int: returns the current value

Usage example:

  • c = Counter(10)
  • c.increment() # 11
  • c.decrement(2) # 9
  • c.get_value() # 9

If you’d like, I can add a small README snippet or a couple of quick tests for this.

Closes #697

New%20session%20-%202026-03-30T05%3A30%3A35.888Z
opencode session  |  github run

Co-authored-by: dzianisv <dzianisv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a counter.py script

0 participants