## Just a really dumb calculator.

Intro:
  go to: Question
  utterances:
    ( |what's|calculate) ${firstNumber:AMAZON.NUMBER} ${operator} ${secondNumber:AMAZON.NUMBER}:
      go to: Validate
    ?:
      go to: Question

Question:
  ask: What would you like to calculate?
  utterances:
    ( |what's|calculate) ${firstNumber:AMAZON.NUMBER} ${operator} ${secondNumber:AMAZON.NUMBER}:
      slots:
        operator:
          type: Operator
          values:
            - value: +
              synonyms:
                - plus
            - value: '-'
              synonyms: 
                - minus
            - value: x
              synonyms: 
                - times
                - multiplied by
            - value: /
              synonyms:
                - divided by
      go to: Validate
    I don't know:
      go to: Exit Skill
    stop:
      go to: Exit Skill
    help:
      go to: Help
    ?:
      speak: I don't understand.

Help:
  speak: I can do addition, subtraction, multiplication, and division.  For example, you can say "1 plus 1", or "10 divided by 5".
  go to: Intro
      
Validate:
  speak: Validating...
  condition:
    expression: firstNumber and operator.strict and secondNumber
    if true:
      go to: Calculate
    if false:
      go to: Don't Understand

Calculate:
  temp:
    expression:
      # all because alexa won't accept asterisks
      # as a slot type value in the intent schema. arrrgggg
      result: ${firstNumber} ${operator.strict.replace('x', '*')} ${secondNumber}
  speak: The result is ${result}.

Don't Understand:
  speak: I don't understand what you said.
  go to: Question

Exit Skill:
  speak: Seeya later.

