te_reo_maori 0.1.4 → 0.1.5

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: 0c8a52e8d2878c16777d0c9dc0dd55f8e6bd06ab3cdba4d80b5a39848ef84668
4
- data.tar.gz: d9e823fbc6fd89bfb00dd8ef07448224da8184eb026bb5e8d6c5cd17113f4eb6
3
+ metadata.gz: 4d7e033dd690ec5a8b082f109638dedcfca0ecd77ec637426486f283b905d229
4
+ data.tar.gz: 733fba9ba22ac5574c552fd9854c961737175e255fce0485ee5031d3958afb91
5
5
  SHA512:
6
- metadata.gz: e3347d474bcfdae117be822b4e7c767d698de58bf92e171db70822ab1e2cab34492c9a804494bc35c2424259e14ec124c0df9ec4b8569b615b27acc008fd37ed
7
- data.tar.gz: af33af46aa99029683bd2e3cdc79322720a31072bb824d9962c21eb4e9b978d380bfccaede06894d1d4ba3db02f867429b8ad8c27e0118a5eeac1ab91bf78968
6
+ metadata.gz: b0f769a32c1154f0a7914b9f4929358223dfea55685ae46b18e2a5f3b89403135e5027c465977c3361eed96c47fe046df18a36a6ff99019d41189a80761c29c1
7
+ data.tar.gz: 5c84a699c686ec242211b051eb682b7abfc0633d6082fb355cac2cc511380c9e073f71bedee4eda849869ba5c909b300ddfcca5bbc31b28e6554cadaac152ae8
data/ChangeLog CHANGED
@@ -1,3 +1,4 @@
1
+ * 0.1.5 - Added simple addition math test
1
2
  * 0.1.4 - Pronounce integers on inspection for better terminal experience
2
3
  - Handle up to 999 and accent marks
3
4
  * 0.1.3 Bug fix. 'Whakahua' did not handle 'iwa' and numbers like toru tekau
@@ -10,9 +10,11 @@ def putanga
10
10
  end
11
11
 
12
12
  extend Tau # Make numbers available
13
+ extend WhakamatautauPangarau
13
14
 
14
15
  puts 'Nau mai haere mai. Welcome to this application for learning and interacting with Maori.'
15
16
  puts 'Type "putanga" to exit'
17
+ puts 'Type "pangarau" for maths test'
16
18
  puts 'Try and perform +, -, * (times), / (divide) with Maori'
17
19
  puts 'The numbers are: '
18
20
  Tau.rarangi.each do |tau, whakamaoritanga|
@@ -20,7 +22,7 @@ Tau.rarangi.each do |tau, whakamaoritanga|
20
22
  end
21
23
  puts 'If you type a number and press you will see Maori equivalent. Numbers > 10 must be wrapped in (). Greatest supported is 999'
22
24
  puts 'Example of bigger numbers. 12: "tekau ma rua". Add 23 + 33: "(rua tekau ma toru) + (toru tekau ma toru)"'
23
- puts 'See integer form by calling "to_s", e.g., "((rua tekau ma toru) + (toru tekau ma toru)).to_s" '
25
+ puts 'See integer form by calling "tau", e.g., "((rua tekau ma toru) + (toru tekau ma toru)).tau" '
24
26
  puts 'If you have any ideas on how this can be improved add issue to https://gitlab.com/samuel-garratt/te_reo_maori/-/issues'
25
27
 
26
28
  IRB.start(__FILE__)
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'te_reo_maori/version'
4
4
  require 'te_reo_maori/tau'
5
+ require 'te_reo_maori/whakamatautau_pangarau'
5
6
 
6
7
  module TeReoMaori
7
8
  class Error < StandardError; end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TeReoMaori
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
@@ -6,6 +6,11 @@ class Integer
6
6
  whakahua
7
7
  end
8
8
 
9
+ # Numeric form of integer
10
+ def tau
11
+ to_s
12
+ end
13
+
9
14
  # @param [Integer] upper_part Integer of number of 100s
10
15
  # @param [String] lower_part Already translated part less than 100
11
16
  def add_parts(upper_part, lower_part)
@@ -0,0 +1,18 @@
1
+ # Math test
2
+ module WhakamatautauPangarau
3
+ # Mathematics. Start a maths test
4
+ def pangarau
5
+ puts 'Nau mai. Please type the answer in Teo Reo Maori (e.g "tahi" for 1) when prompted'
6
+ tau1 = rand(100).to_i
7
+ tau2 = rand(100).to_i
8
+ whakautu_tika = tau1 + tau2 + 1
9
+ puts "#{tau1.inspect} + #{tau2.inspect}?"
10
+ whakautu = eval(gets).to_i
11
+ if whakautu == whakautu_tika
12
+ puts 'Ka pai. Correct!'
13
+ else
14
+ puts "Incorrect. You put '#{whakautu.inspect} (#{whakautu})'.
15
+ Correct answer is '#{whakautu_tika.inspect} (#{whakautu_tika})'"
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: te_reo_maori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-19 00:00:00.000000000 Z
11
+ date: 2020-09-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tool to aid one to learn Maori and enable one to program in Maori.
14
14
  email:
@@ -35,6 +35,7 @@ files:
35
35
  - lib/te_reo_maori/tau.rb
36
36
  - lib/te_reo_maori/version.rb
37
37
  - lib/te_reo_maori/whakahua.rb
38
+ - lib/te_reo_maori/whakamatautau_pangarau.rb
38
39
  - te_reo_maori.gemspec
39
40
  homepage: https://gitlab.com/samuel-garratt/te_reo_maori
40
41
  licenses: