README.md (1556B) - raw
1 # Wordy 2 3 Welcome to Wordy on Exercism's Perl 5 Track. 4 If you need help running the tests or submitting your code, check out `HELP.md`. 5 6 ## Instructions 7 8 Parse and evaluate simple math word problems returning the answer as an integer. 9 10 ## Iteration 0 — Numbers 11 12 Problems with no operations simply evaluate to the number given. 13 14 > What is 5? 15 16 Evaluates to 5. 17 18 ## Iteration 1 — Addition 19 20 Add two numbers together. 21 22 > What is 5 plus 13? 23 24 Evaluates to 18. 25 26 Handle large numbers and negative numbers. 27 28 ## Iteration 2 — Subtraction, Multiplication and Division 29 30 Now, perform the other three operations. 31 32 > What is 7 minus 5? 33 34 2 35 36 > What is 6 multiplied by 4? 37 38 24 39 40 > What is 25 divided by 5? 41 42 5 43 44 ## Iteration 3 — Multiple Operations 45 46 Handle a set of operations, in sequence. 47 48 Since these are verbal word problems, evaluate the expression from 49 left-to-right, _ignoring the typical order of operations._ 50 51 > What is 5 plus 13 plus 6? 52 53 24 54 55 > What is 3 plus 2 multiplied by 3? 56 57 15 (i.e. not 9) 58 59 ## Iteration 4 — Errors 60 61 The parser should reject: 62 63 * Unsupported operations ("What is 52 cubed?") 64 * Non-math questions ("Who is the President of the United States") 65 * Word problems with invalid syntax ("What is 1 plus plus 2?") 66 67 ## Bonus — Exponentials 68 69 If you'd like, handle exponentials. 70 71 > What is 2 raised to the 5th power? 72 73 32 74 75 ## Source 76 77 ### Created by 78 79 - @szabgab 80 81 ### Contributed to by 82 83 - @kytrinyx 84 - @m-dango 85 - @rfilipo 86 87 ### Based on 88 89 Inspired by one of the generated questions in the Extreme Startup game. - https://github.com/rchatley/extreme_startup