hchiam / please

An experimental programming language (transpiler) to make it easier to write code with speech recognition.
MIT License
1 stars 1 forks source link

fix transformer.py to create pseudo-fibonacci code properly #57

Closed hchiam closed 7 years ago

hchiam commented 7 years ago

Check that output code.py looks right after you input into https://github.com/hchiam/please/blob/master/transformer.py the following code:

please no need to say please
define function fake fibonacci with number
    if variable number equals zero then return zero
    if variable number equals one then return one
    assign use function fake fibonacci on variable number minus one to variable answer
    return variable answer
end function

assign use function fake fibonacci with zero to variable output
print step 1: output = variable output
assign use function fake fibonacci with one to variable output
print step 2: output = variable output
assign use function fake fibonacci with two to variable output
print step 3: output = variable output
assign use function fake fibonacci with three to variable output
print step 4: output = variable output
import format from library
use clean of format
hchiam commented 7 years ago

https://github.com/hchiam/please/blob/master/transformer.py now correctly outputs with transformer.py:

step 1: output = 0
step 2: output = 1
step 3: output = 1
step 4: output = 1