codenjoy-client 0.1.004 → 0.1.005

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a09cfcf47c03bb77656e20fc50f500e62339867aa5aca6eba23188a682eaf2bd
4
- data.tar.gz: 27e944267e286e114d46d5429a645aa96b1dd14928de8af19d2239a3e5d4ac1d
3
+ metadata.gz: 9e477261e4162dccd520d1b326aa2b4a76ddd1bf46e00f6b7f97077c0777b34f
4
+ data.tar.gz: 44b029ca63757250811b068d2b3683f20929f8a83f3796426e7f8ed7fe49f10c
5
5
  SHA512:
6
- metadata.gz: b7ff685d0fa59b5078707ef1119ca3c342d6979ef3ab257aab40624294f7c230c3fdcbdac3781d75f5d61468edceb65c2f63a5c158e29f1c89c84f5f35540e96
7
- data.tar.gz: acefd306b2cada55765bce5524aa3825d86a633276ff5e852f85a153781da52397264ce3cd5fb08896a643febc1d8bec66d03eb61b0443113c30380469b8cadc
6
+ metadata.gz: 982339bf4a042480c94f532cf5760412f6f6395afafafd9474c025059cf674d0bd461fbb1ee3aa84f4430577d6c57e5a7cf9f6ea9adce936f9a4d0135e653439
7
+ data.tar.gz: 455064e8834253c0ae9d739aeb1a4717a980c7398c29c1258c16846da60651f877db362d7f2add4dab30e0f316d6463363b05a2ab9311dd70bb025da026a267a
@@ -1,5 +1,5 @@
1
1
  module Codenjoy
2
2
  module Client
3
- VERSION = "0.1.004"
3
+ VERSION = "0.1.005"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@
2
2
  require "bundler/setup"
3
3
  require "codenjoy/client"
4
4
  require "codenjoy/games/battlecity/board"
5
+ require "codenjoy/games/tetris/board"
5
6
 
6
7
  class YourSolver
7
8
  # UP: 'up', // you can move
@@ -18,7 +19,7 @@ class YourSolver
18
19
  #
19
20
  #######################################################################
20
21
 
21
- return 'act'
22
+ return 'down'
22
23
  end
23
24
 
24
25
  end
@@ -26,17 +27,18 @@ end
26
27
  game = Codenjoy::Client::Game.new
27
28
  # board = Codenjoy::Client::Games::Battlecity::Board.new
28
29
  board = Codenjoy::Client::Games::Tetris::Board.new
29
-
30
+ solver = YourSolver.new
30
31
  url = "https://dojorena.io/codenjoy-contest/board/player/70xewv6o7ddy9yphm1u0?code=2603484461919438773&gameName=battlecity"
31
32
  count = 0
32
33
 
33
34
 
35
+
34
36
  game.play(url) do |ws, msg|
35
37
  json = msg[6..-1].force_encoding('UTF-8')
36
38
  board.process(json)
37
39
  puts board.to_s
38
40
 
39
- ws.send('Up')
41
+ ws.send solver.get_answer(board)
40
42
  p count
41
43
  count += 1
42
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codenjoy-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.004
4
+ version: 0.1.005
5
5
  platform: ruby
6
6
  authors:
7
7
  - vgulaev