Coder Social home page Coder Social logo

submarine_game's People

Contributors

kn2423 avatar kurorororo avatar mak4026 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

submarine_game's Issues

manual_playerで存在しない艦を移動させようとするとエラーが出る

please input "w" or "c" or "s"
select your ship: c
x = 3
y = 0
players/manual_player.rb:34:in `action': undefined method `reachable?' for nil:NilClass (NoMethodError)
    from players/manual_player.rb:230:in `block in main'
    from players/manual_player.rb:225:in `loop'
    from players/manual_player.rb:225:in `main'
    from players/manual_player.rb:249:in `<main>'

反則負け/勝ちの場合に例外が発生する

players/state_player.rb:156:in `update': undefined method `[]' for false:FalseClass (NoMethodError)
    from players/state_player.rb:220:in `block in main'
    from players/state_player.rb:213:in `loop'
    from players/state_player.rb:213:in `main'
    from players/state_player.rb:234:in `<main>'

おそらくupdateのときに、jsonの存在しないキーを見に行ってしまうのが原因

クライアントが反則勝ちできてしまう

waiting
{"moved"=>false}
{"me"=>{"w"=>{"hp"=>3, "position"=>[3, 0]}}, "enemy"=>{"w"=>{"hp"=>2}, "c"=>{"hp"=>2}, "s"=>{"hp"=>1}}}
players/ai_player_simple.rb:110:in `update': undefined method `[]' for false:FalseClass (NoMethodError)
    from players/ai_player_simple.rb:138:in `block in main'
    from players/ai_player_simple.rb:131:in `loop'
    from players/ai_player_simple.rb:131:in `main'
    from players/ai_player_simple.rb:152:in `<main>'

どうも行動結果のJSONに不正な値を入れられると死んでしまうよう

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.