Code Monkey home page Code Monkey logo

noughts_and_crosses's Introduction

Noughts and crosses (tic-tac-toe) solver

This is my first Rust program after a day of reading ‘The Book’. It solves noughts and crosses and outputs the result:

Analysed 38856 games in 1772 microseconds
Noughts and crosses is a draw with perfect play

I’m sharing it on GitHub because I would appreciate feedback on whether I’m doing things in the proper Rust way, or whether I’m transferring habits from JavaScript and PHP that aren’t very Rust-like. In particular:

  • Is there a better way of structuring any element of the program using Rust features I haven’t learned yet?
  • Am I commenting things appropriately?
  • Am I testing things appropriately? (Although this isn’t Rust-specific, what is the appropriate way of testing the solve function, given the purpose of the program is to find what result it will give so the tests shouldn’t assume a particular result?)

Please make suggestions (which I’ll then try to implement as part of my learning process) through GitHub issues or by messaging me on Mastodon (@[email protected]).

noughts_and_crosses's People

Contributors

katemorley avatar

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.