Git Product home page Git Product logo

conwaygameoflife's Introduction

Conway's Game of Life API

Overview

This ASP.NET Core Web API provides a backend for Conway's Game of Life. It allows users to create game boards, retrieve and calculate future states of the board, and find final states.

Features

  • Upload new board states and receive a unique board ID
  • Retrieve the next state of a board
  • Get a specified number of future states for a board
  • Find the final state of a board within a certain number of iterations
  • Persist board states in a database to retain state across service restarts

Getting Started

Prerequisites

  • .NET 7.0 SDK
  • Visual Studio 2022 (or later) / Visual Studio Code
  • SQL Server (for database-related operations)

Installation

  1. Clone the repository:
    git clone https://github.com/marylin/ConwayGameOfLife.git
    

Installation

  1. Open the solution in Visual Studio or Visual Studio Code.

  2. Restore NuGet packages:

    dotnet restore
  3. Update the database (if using Entity Framework Core):

    dotnet ef database update
    
    

Usage

Endpoints

  • POST /api/boards: Create a new board.
  • GET /api/boards/{id}/next: Get the next state of a board.
  • GET /api/boards/{id}/future/{steps}: Get future states of a board.
  • GET /api/boards/{id}/final/{maxIterations}: Find the final state of a board.

Examples

Creating a board:

curl -X POST http://localhost:5000/api/boards -H "Content-Type: application/json" -d "{ \"initialState\": [[true, false], [false, true]] }"




  

conwaygameoflife's People

Contributors

marylin avatar

Watchers

 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.