== Classes:
-=== Mint::Reader
-Read answer from user.
+== Mint::Expression
+This class represents an expression.
+
+ expression = Mint::Expression.new('5 div 4', expression_tree)
+ p expression.to_s #=> '5 div 4'
+ p expression.to_maxima #=> '5 / 4'
+ p expression.to_latex #=> '5 \div 4'
+ p expression.normalize #=> '5 div 4'
+
+=== Mint::Builder
+This class builds expression from string.
input = Readline.readline('>')
begine
- answer = Mint::Reader.read(input)
+ answer = Mint::Builder.build(input)
+ p answer.class
+ #=> Mint::Expression
rescue
puts 'Please check your answer.'
end
You must inheritance this class.
and over wirte #generate_problem method.
-==== FourArithmetic
+==== FourArithmetic (Example)
For four arithmetic operations.
:rage option is required.
to make original engine.
and over write #solve method.
-===== FourArithmetic
+===== FourArithmetic (Example)
Four arithmetic operations solver engine.
-== Mint::Expression
-This class represents an expression.
-
- expression = Mint::Expression.new('5 div 4', :string => '5 / 4')
- p expression.to_s #=> '5 div 4'
- p expression.to_latex #=> '$$5 \divide 4$$'
- p expression.normalize #=> '5 / 4'
+== TODO:
+Move description to code.