All Downloads are FREE. Search and download functionalities are using the official Maven repository.

APT.Arithmetic-smem.arithmetic.finish-problem.soar Maven / Gradle / Ivy

sp {arithmetic*propose*finish-problem
   (state  ^name arithmetic
              ^count 
              ^arithmetic-problem.current-column )
   ( ^result
        ^next-column nil)
-->
   ( ^operator  + =)
   ( ^name finish-problem
         ^count 
                )#     ^count-mod (mod  100))
}

sp {arithmetic*apply*finish-problem*decrement-count
   (state  ^name arithmetic
              ^operator 
              ^arithmetic-problem 
              ^count )
   (  ^name finish-problem
         ^count )
-->
   ( ^arithmetic-problem  -
        ^count  -
               (-  1))
}

sp {arithmetic*apply*finish-problem*advance-to-next-problem
   (state  ^name arithmetic
              ^operator 
              ^current-problem )
   (  ^name finish-problem)
   ( ^next )
-->
   ( ^current-problem  - )
}

########## Print out problem and answer #############
sp {arithmetic*apply*finish-problem*1column*result
   (state  ^name arithmetic
              ^parameters.output yes
              ^operator 
              ^arithmetic-problem )
   (  ^name finish-problem)
   ( ^one-column 
         ^operation-symbol )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column nil)
-->
   (write (crlf) (crlf) | |  )
   (write (crlf)   )
   (write (crlf) |--|)
   (write (crlf) | |  )
}
sp {arithmetic*apply*finish-problem*2column*result
   (state  ^name arithmetic
              ^parameters.output yes
              ^operator 
              ^arithmetic-problem )
   (  ^name finish-problem)
   ( ^one-column 
         ^operation-symbol )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column nil)
-->
   (write (crlf) (crlf) | |     )
   (write (crlf)     )
   (write (crlf) |---|)
   (write (crlf) | |    )
}

sp {arithmetic*apply*finish-problem3*column*result
   (state  ^name arithmetic
              ^parameters.output yes
              ^operator 
              ^arithmetic-problem )
   (  ^name finish-problem)
   ( ^one-column 
         ^operation-symbol )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column nil)
-->
   (write (crlf) | |)
   (write (crlf) | |      )
   (write (crlf)      )
   (write (crlf) |----|)
   (write (crlf) | |     )
}

sp {arithmetic*apply*finish-problem4*column*result
   (state  ^name arithmetic
              ^parameters.output yes
              ^operator 
              ^arithmetic-problem )
   (  ^name finish-problem)
   ( ^one-column 
         ^operation-symbol )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column )
   ( ^digit1.digit 
         ^digit2.digit 
         ^result.digit 
         ^next-column nil)
-->
   (write (crlf) | |)
   (write (crlf) | |       )
   (write (crlf)       )
   (write (crlf) |----|)
   (write (crlf) | |     )
}