Giter Site home page Giter Site logo

chess-clock's People

Contributors

spkuehl avatar

Watchers

 avatar  avatar

Forkers

randpharoah

chess-clock's Issues

Variable names

b and s are not good variables. I do not know appropriate names.

Initial main while loop took me some time to understand. A comment makes its purpose clear.

I do not know how you start the clock. Looks like its by pressing s button. Could this be dropped if first button starts the clock of other player? That's how I use existing clocks.

Code Review

Following comments are about the current code. They do not reflect possible things that might be intended for future development.

Method get_display in CountdownTimer implies return value. It does not. Name should change to reflect no return.

Method get_display has parameter time_left. It is part of self. Method does reference self. time_left. Parameter could be dropped and use self. time_left everywhere.

init parameter: increment=0 may not be appropriate. Can a timer work with zero increment?

Line

time_display = self.get_time_remaining()
sets local variable time_display. It is not used. In IDE check for other unused variables.

In main method, True loop has duplicate code. Design change could reduce duplicate code. Replace player_1 and player_2 with an array and two variables for active and paused index.

Design a setup/menu system to configure game settings.

When the device boots up the first thing to do is configure and confirm game settings.

  • Clock Times (eg. 10 min/player)
  • Increment (eg. 5 seconds/move)

Could have 10+5 as the default.

In addition to software enhancements, there will probably need to be an additional button (select) added to the hardware.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.