learn-japanese 0.2.0 → 0.3.0

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: d2ec60ea1cf0584f51aeee2842a47ec7de047491ce73af9e956bd215a78b1ddb
4
- data.tar.gz: f65e3e5ed7f142d937fbaef0ab3bcf79c4cc67d48db10ae5838a069a9bc74169
3
+ metadata.gz: 202866524b01fc9e92e9bd4c48202bd531ab41a0bf2fea02e09cb8bd4284d3f9
4
+ data.tar.gz: 12c8fbfaeaa588d9feea0922f0542c11f68b5e84021fe70aaf3942fba912278d
5
5
  SHA512:
6
- metadata.gz: 91daba15167b84c4afcda4fc4304ee1eb3b2d5795d6640c0d1d473272a2c98308d85244252fabd4372e2c9e527912b039b807e6b068b31e751c9fd795c41d91e
7
- data.tar.gz: f7da100575faf4741ede2f91c2cd8a59767ff11b14c6a58955594ecaf19569ef9a9a735defc4a901d6d0a3f73ee371e7001fc66f9d6a861da5bd25c26584fa49
6
+ metadata.gz: 94a3a3eee5cd329d85ed9a06a9a588a9b67a96c79214ecbfd0b1a404736b34767227e1e227c8ee762a3293231f2a09cb25c1621baa3b4d0b40d8e5eeb233ff1f
7
+ data.tar.gz: bddfb89443c7551257d3cffb8b43030fd8492734d71e933012e143014dee5662219f17678898150888f85c6974758e3b74b4ee20aec373da0e5d6e7a748ab8c3
data/README.md CHANGED
@@ -14,8 +14,11 @@ Para instalar el programa:
14
14
 
15
15
  ## Modo de Uso
16
16
 
17
- 1. Abrir un terminal
18
- 2. Ejecutar `short-answer-game`.
17
+ Abrir un terminal
18
+ * Ejecutar `short-answer-game`, para el juego de preguntas donde debemos escribir la respuesta.
19
+ * Ejecutar `choose-answer-game`, para el juego de preguntas donde debemos elegir la respuesta correcta.
20
+
21
+ > NOTA: Para aumentar la dificultad haremos `short-answer-game NUMBER`, donde NUMBER será un valor entre 1-4 por el momento.
19
22
 
20
23
  # Silabario japonés
21
24
 
@@ -3,6 +3,6 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
3
 
4
4
  require 'learn-japanese/game/choose-answer-game'
5
5
 
6
- level = 2
6
+ level = ARGV.first.to_i || 1
7
7
  ChooseAnswerGame.show_help(level)
8
8
  ChooseAnswerGame.new(level).run
@@ -3,6 +3,6 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
3
 
4
4
  require 'learn-japanese/game/short-answer-game'
5
5
 
6
- level = 2
6
+ level = ARGV.first.to_i || 1
7
7
  ShortAnswerGame.show_help(level)
8
8
  ShortAnswerGame.new(level).run
@@ -8,10 +8,13 @@ class ChooseAnswerGame
8
8
  def initialize(level=1)
9
9
  @level = level
10
10
  @score = 1
11
- @max_score = 20
11
+ @max_score = 10
12
12
 
13
13
  @silabario = Hiragana.group1
14
14
  @silabario.merge! Hiragana.group2 if @level > 1
15
+ @silabario.merge! Hiragana.group3 if @level > 2
16
+ @silabario.merge! Hiragana.group4 if @level > 3
17
+
15
18
  @keys = @silabario.keys
16
19
  end
17
20
 
@@ -8,10 +8,13 @@ class ShortAnswerGame
8
8
  def initialize(level=1)
9
9
  @level = level
10
10
  @score = 1
11
- @max_score = 20
11
+ @max_score = 10
12
12
 
13
13
  @silabario = Hiragana.group1
14
14
  @silabario.merge! Hiragana.group2 if @level > 1
15
+ @silabario.merge! Hiragana.group3 if @level > 2
16
+ @silabario.merge! Hiragana.group4 if @level > 3
17
+
15
18
  @keys = @silabario.keys
16
19
  end
17
20
 
@@ -23,7 +26,7 @@ class ShortAnswerGame
23
26
  Debug.puts_line
24
27
  while @score < @max_score
25
28
  @keys.shuffle!
26
- @keys.each { |key| guess_japanise_symbol(key) }
29
+ guess_japanise_symbol(@keys[0])
27
30
  end
28
31
  end
29
32
 
@@ -22,11 +22,31 @@ class Hiragana
22
22
  }
23
23
  end
24
24
 
25
+ def self.group3
26
+ { sa: "\u{3055}",
27
+ si: "\u{3057}",
28
+ su: "\u{3059}",
29
+ se: "\u{305B}",
30
+ so: "\u{305D}"
31
+ }
32
+ end
33
+
34
+ def self.group4
35
+ { ta: "\u{305F}",
36
+ ti: "\u{3061}",
37
+ tu: "\u{3064}",
38
+ te: "\u{3066}",
39
+ to: "\u{3068}"
40
+ }
41
+ end
42
+
25
43
  def self.show_help(level=1)
26
44
  Debug.puts_line
27
45
  puts "Hiragana help\n".upcase.cyan
28
46
 
29
47
  Debug.puts_group Hiragana.group1
30
48
  Debug.puts_group Hiragana.group2 if level > 1
49
+ Debug.puts_group Hiragana.group3 if level > 2
50
+ Debug.puts_group Hiragana.group4 if level > 3
31
51
  end
32
52
  end
@@ -1,5 +1,5 @@
1
1
 
2
2
  module JaponesTool
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  HOMEPAGE = 'https://github.com/dvarrui/learn-japanese'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-japanese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz