File: basic_sum.tr

package info (click to toggle)
turing 0.11~beta-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,152 kB
  • sloc: python: 103,898; xml: 101; makefile: 50; sh: 29
file content (1 line) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (4)
1
BlockStmt([CommentStmt('Displays the sum of all integers from 1 to user-inputted number'), AssignStmt(IdentifierNode('s'), NumberNode(0)), InputStmt(IdentifierNode('n'), None), ForStmt('i', NumberNode(1), IdentifierNode('n'), [AssignStmt(IdentifierNode('s'), BinOpNode(IdentifierNode('s'), IdentifierNode('i'), '+'))], None), DisplayStmt(StringNode('Sum: ')), DisplayStmt(IdentifierNode('s'))])