Resistance calculator: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 169:
@b.setVoltage @voltage
build = (
stack = []
for word in s.split ' '
Line 175:
else if word == '*' then stack.push new Parallel stack.pop(), stack.pop()
else stack.push new Resistor parseFloat word
node.setVoltage voltage▼
node = build
print " Ohm Volt Ampere Watt Network tree"
node.report ""
|