sashite-cgsn 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/lib/sashite/cgsn.rb +22 -22
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ad5676b320060471229ab9926bce89a0c9435a327404f8a8d1bed076f502566
4
- data.tar.gz: 99266756eb144bd3910035559859102d442a1dff5e6e7b3ae06cdbade39a4b82
3
+ metadata.gz: 3013f074440a18a711503672a4ea6e37307692d3c58b64742530e267330e9ca6
4
+ data.tar.gz: 68864b081fbf338eb2bec945295695064f0d19acac1a4ac37ec313f99bb7f09d
5
5
  SHA512:
6
- metadata.gz: 075a7253c398c3bebf01b9ec5e19d6ed4ac1445fb35f2b6451583b176841fb7d0645f95302afdaf73cfb0b6af964814442dc272810ded910e6d69fab062cb379
7
- data.tar.gz: 57aade4830f9ed6f9ad57294881b1e0659296d18f1da8a9e21434164186701b359848909b3c02747841f436d0d4a9328f85cabac7ccf44d5ec4d19cf450e78b2
6
+ metadata.gz: 86d1393ca014e448c7ca00193e3faba5968da1599783ea21a88575584a13dbf8669aabdeb44fb5aea45f0b0165e08365141411117320317189152bf984c8c2d1
7
+ data.tar.gz: e0745151074883807146c8114856f3675b75417676821baedf5e7e29d79994c0340e4ffe977243e71ad0c3e17dab1e91c7f2e8814b02c938aa04b5b87556ab44
data/README.md CHANGED
@@ -32,9 +32,9 @@ CGSN status values are lowercase strings using underscore separators:
32
32
 
33
33
  ```ruby
34
34
  "checkmate"
35
- "bare_king"
36
- "time_limit"
37
- "in_progress"
35
+ "bareking"
36
+ "timelimit"
37
+ "stale"
38
38
  ```
39
39
 
40
40
  ## API Reference
@@ -110,11 +110,11 @@ Sashite::Cgsn.valid?("invalid") # => false
110
110
 
111
111
  # Check inference capability
112
112
  Sashite::Cgsn.inferable?("stalemate") # => true
113
- Sashite::Cgsn.explicit_only?("time_limit") # => true
113
+ Sashite::Cgsn.explicit_only?("timelimit") # => true
114
114
 
115
115
  # Get all statuses
116
116
  Sashite::Cgsn.statuses
117
- # => ["in_progress", "checkmate", "stalemate", ...]
117
+ # => ["stale", "checkmate", "stalemate", ...]
118
118
  ```
119
119
 
120
120
  ## Properties
data/lib/sashite/cgsn.rb CHANGED
@@ -13,38 +13,38 @@ module Sashite
13
13
  module Cgsn
14
14
  # Complete list of all defined CGSN status values
15
15
  STATUSES = %w[
16
- in_progress
16
+ stale
17
17
  checkmate
18
18
  stalemate
19
- staleturn
20
- bare_king
21
- mare_king
19
+ nomove
20
+ bareking
21
+ mareking
22
22
  insufficient
23
23
  resignation
24
- illegal_move
25
- time_limit
26
- move_limit
24
+ illegalmove
25
+ timelimit
26
+ movelimit
27
27
  repetition
28
28
  agreement
29
29
  ].freeze
30
30
 
31
31
  # Statuses that can be inferred from position analysis
32
32
  INFERABLE_STATUSES = %w[
33
- in_progress
33
+ stale
34
34
  checkmate
35
35
  stalemate
36
- staleturn
37
- bare_king
38
- mare_king
36
+ nomove
37
+ bareking
38
+ mareking
39
39
  insufficient
40
40
  ].freeze
41
41
 
42
42
  # Statuses that require explicit declaration
43
43
  EXPLICIT_ONLY_STATUSES = %w[
44
44
  resignation
45
- illegal_move
46
- time_limit
47
- move_limit
45
+ illegalmove
46
+ timelimit
47
+ movelimit
48
48
  repetition
49
49
  agreement
50
50
  ].freeze
@@ -56,8 +56,8 @@ module Sashite
56
56
  #
57
57
  # @example
58
58
  # Sashite::Cgsn.valid?("checkmate") # => true
59
- # Sashite::Cgsn.valid?("staleturn") # => true
60
- # Sashite::Cgsn.valid?("time_limit") # => true
59
+ # Sashite::Cgsn.valid?("nomove") # => true
60
+ # Sashite::Cgsn.valid?("timelimit") # => true
61
61
  # Sashite::Cgsn.valid?("invalid") # => false
62
62
  # Sashite::Cgsn.valid?("Checkmate") # => false
63
63
  # Sashite::Cgsn.valid?(:checkmate) # => true (converts to "checkmate")
@@ -76,7 +76,7 @@ module Sashite
76
76
  #
77
77
  # @example
78
78
  # Sashite::Cgsn.parse("checkmate") # => #<Cgsn::Status value="checkmate">
79
- # Sashite::Cgsn.parse("staleturn") # => #<Cgsn::Status value="staleturn">
79
+ # Sashite::Cgsn.parse("nomove") # => #<Cgsn::Status value="nomove">
80
80
  # Sashite::Cgsn.parse("resignation") # => #<Cgsn::Status value="resignation">
81
81
  def self.parse(value)
82
82
  Status.new(value)
@@ -89,7 +89,7 @@ module Sashite
89
89
  #
90
90
  # @example
91
91
  # Sashite::Cgsn.inferable?("checkmate") # => true
92
- # Sashite::Cgsn.inferable?("staleturn") # => true
92
+ # Sashite::Cgsn.inferable?("nomove") # => true
93
93
  # Sashite::Cgsn.inferable?("resignation") # => false
94
94
  def self.inferable?(status)
95
95
  status_string = String(status)
@@ -106,7 +106,7 @@ module Sashite
106
106
  # @example
107
107
  # Sashite::Cgsn.explicit_only?("resignation") # => true
108
108
  # Sashite::Cgsn.explicit_only?("checkmate") # => false
109
- # Sashite::Cgsn.explicit_only?("staleturn") # => false
109
+ # Sashite::Cgsn.explicit_only?("nomove") # => false
110
110
  def self.explicit_only?(status)
111
111
  status_string = String(status)
112
112
  EXPLICIT_ONLY_STATUSES.include?(status_string)
@@ -120,7 +120,7 @@ module Sashite
120
120
  #
121
121
  # @example
122
122
  # Sashite::Cgsn.statuses
123
- # # => ["in_progress", "checkmate", "stalemate", "staleturn", ...]
123
+ # # => ["stale", "checkmate", "stalemate", "nomove", ...]
124
124
  def self.statuses
125
125
  STATUSES.dup
126
126
  end
@@ -131,7 +131,7 @@ module Sashite
131
131
  #
132
132
  # @example
133
133
  # Sashite::Cgsn.inferable_statuses
134
- # # => ["in_progress", "checkmate", "stalemate", "staleturn", ...]
134
+ # # => ["stale", "checkmate", "stalemate", "nomove", ...]
135
135
  def self.inferable_statuses
136
136
  INFERABLE_STATUSES.dup
137
137
  end
@@ -142,7 +142,7 @@ module Sashite
142
142
  #
143
143
  # @example
144
144
  # Sashite::Cgsn.explicit_only_statuses
145
- # # => ["resignation", "illegal_move", "time_limit", ...]
145
+ # # => ["resignation", "illegalmove", "timelimit", ...]
146
146
  def self.explicit_only_statuses
147
147
  EXPLICIT_ONLY_STATUSES.dup
148
148
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sashite-cgsn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
@@ -13,9 +13,9 @@ description: |
13
13
  CGSN (Chess Game Status Notation) provides a rule-agnostic taxonomy of observable game status
14
14
  values for abstract strategy board games. This gem implements the CGSN Specification v1.0.0 with
15
15
  a minimal Ruby interface featuring immutable status objects and functional programming principles.
16
- CGSN defines standardized identifiers for terminal conditions (checkmate, stalemate, bare_king,
17
- mare_king, insufficient), player actions (resignation, agreement, illegal_move), and temporal
18
- constraints (time_limit, move_limit, repetition), enabling precise and portable status identification
16
+ CGSN defines standardized identifiers for terminal conditions (checkmate, stalemate, bareking,
17
+ mareking, insufficient), player actions (resignation, agreement, illegalmove), and temporal
18
+ constraints (timelimit, movelimit, repetition), enabling precise and portable status identification
19
19
  across multiple games and variants. Perfect for game engines, notation systems, and hybrid gaming
20
20
  platforms requiring consistent, rule-agnostic game state representation.
21
21
  email: contact@cyril.email