回答編集履歴

3

メソッド名を恰好良さげにしてみた

2022/05/25 07:33

投稿

jimbe
jimbe

スコア12648

test CHANGED
@@ -14,10 +14,10 @@
14
14
  this.winPoint = winPoint;
15
15
  }
16
16
 
17
- boolean isDraw(Rsp other) {
17
+ boolean drawsWith(Rsp other) {
18
18
  return ordinal() == other.ordinal();
19
19
  }
20
- boolean isMyWin(Rsp other) {
20
+ boolean isWinBy(Rsp other) {
21
21
  return (ordinal() + 1) % values().length == other.ordinal();
22
22
  }
23
23
  }

2

追記

2022/05/25 06:15

投稿

jimbe
jimbe

スコア12648

test CHANGED
@@ -1,4 +1,4 @@
1
- 私ならまずは rsp 配列を enum にします。
1
+ 私ならまずは rsp 配列を enum にし、判定やポイントを持たせます。
2
2
 
3
3
  ```java
4
4
  enum Rsp {

1

誤字

2022/05/25 06:14

投稿

jimbe
jimbe

スコア12648

test CHANGED
@@ -14,7 +14,7 @@
14
14
  this.winPoint = winPoint;
15
15
  }
16
16
 
17
- boolean isDrow(Rsp other) {
17
+ boolean isDraw(Rsp other) {
18
18
  return ordinal() == other.ordinal();
19
19
  }
20
20
  boolean isMyWin(Rsp other) {