Coder Social home page Coder Social logo

tlwr-dpye-ld's Introduction

tlwr dpye ld

Repository to store golang code from "The Go Programming Language" by Donovan and Kernighan.

tlwr-dpye-ld's People

Contributors

szd55gds avatar tlwr avatar

Stargazers

 avatar

Watchers

Tom avatar James Cloos avatar Rebecca Law avatar Sebastian Schmieschek avatar Stephen Harker avatar  avatar

tlwr-dpye-ld's Issues

Challenge: circle game

X people are standing in a ring, after Y-1 people are skipped the next person takes a step back and leaves the ring. This repeats until only one person remains, who is the winner.

Concrete example

X = 5
Y = 4

1 2 3 4 5
^

1 2 3 X 5
      x

1 2 3 X 5
        ^

1 2 X X 5
    x

1 2 X X 5
        ^

1 2 X X X
        x

1 2 X X X
^

1 X X X X
  x

Winner: 1

Other examples:

X: 31
Y: 4
Winner: 10
X: 21
Y: 14
Winner: 4

Todo

  • Write tests for the examples above
  • Write a function such that the tests pass
  • Hook up the solver such running ./solver X Y prints the answer, e.g. ./solver 31 4 prints 10
  • Hook up the solver such that sending an HTTP request to localhost:8080?X=31&Y=4 returns 10

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.