Skip to content

Commit

Permalink
chore: for loop example minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Kim (Hyunggun) committed Dec 5, 2024
1 parent 85c9fc2 commit 44b2461
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,31 @@ for_loop_for_body@2:

for_loop_after_for@5:
int 0
frame_bury 3
frame_bury 0
int 1
frame_bury 2

for_loop_for_header@6:
frame_dig 3
int 4
frame_dig 2
int 5
<
dup
frame_bury 0
bz for_loop_after_for@9
frame_dig 3
dup
itob
extract 7 1
frame_dig 0
assert // Index access is out of bounds
frame_dig 1
dig 2
uncover 2
replace3
frame_bury 1
frame_dig 2
dup
cover 2
+
frame_bury 0
int 1
+
frame_bury 3
frame_bury 2
b for_loop_for_header@6

for_loop_after_for@9:
frame_dig 0
int 10
==
assert
frame_dig 1
frame_bury 0
retsub
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
},
"source": {
"approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuY29udHJvbF9mbG93LmNvbnRyYWN0LkZvckxvb3BzRXhhbXBsZS5hcHByb3ZhbF9wcm9ncmFtOgogICAgY2FsbHN1YiBfX3B1eWFfYXJjNF9yb3V0ZXJfXwogICAgcmV0dXJuCgoKLy8gc21hcnRfY29udHJhY3RzLmNvbnRyb2xfZmxvdy5jb250cmFjdC5Gb3JMb29wc0V4YW1wbGUuX19wdXlhX2FyYzRfcm91dGVyX18oKSAtPiB1aW50NjQ6Cl9fcHV5YV9hcmM0X3JvdXRlcl9fOgogICAgcHJvdG8gMCAxCiAgICB0eG4gTnVtQXBwQXJncwogICAgYnogX19wdXlhX2FyYzRfcm91dGVyX19fYmFyZV9yb3V0aW5nQDUKICAgIG1ldGhvZCAiZm9yX2xvb3AoKXVpbnQ4WzRdIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggX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2FmdGVyX2ZvckA5OgogICAgZnJhbWVfZGlnIDAKICAgIGludCAxMAogICAgPT0KICAgIGFzc2VydAogICAgZnJhbWVfZGlnIDEKICAgIGZyYW1lX2J1cnkgMAogICAgcmV0c3ViCg==",
"clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuY29udHJvbF9mbG93LmNvbnRyYWN0LkZvckxvb3BzRXhhbXBsZS5jbGVhcl9zdGF0ZV9wcm9ncmFtOgogICAgaW50IDEKICAgIHJldHVybgo="
},
"state": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"source": {
"approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuY29udHJvbF9mbG93LmNvbnRyYWN0LkZvckxvb3BzRXhhbXBsZS5hcHByb3ZhbF9wcm9ncmFtOgogICAgY2FsbHN1YiBfX3B1eWFfYXJjNF9yb3V0ZXJfXwogICAgcmV0dXJuCgoKLy8gc21hcnRfY29udHJhY3RzLmNvbnRyb2xfZmxvdy5jb250cmFjdC5Gb3JMb29wc0V4YW1wbGUuX19wdXlhX2FyYzRfcm91dGVyX18oKSAtPiB1aW50NjQ6Cl9fcHV5YV9hcmM0X3JvdXRlcl9fOgogICAgcHJvdG8gMCAxCiAgICB0eG4gTnVtQXBwQXJncwogICAgYnogX19wdXlhX2FyYzRfcm91dGVyX19fYmFyZV9yb3V0aW5nQDUKICAgIG1ldGhvZCAiZm9yX2xvb3AoKXVpbnQ4WzRdIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggX19wdXlhX2FyYzRfcm91dGVyX19fZm9yX2xvb3Bfcm91dGVAMgogICAgaW50IDAKICAgIHJldHN1YgoKX19wdXlhX2FyYzRfcm91dGVyX19fZm9yX2xvb3Bfcm91dGVAMjoKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb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vbF9mbG93LmNvbnRyYWN0LkZvckxvb3BzRXhhbXBsZS5jbGVhcl9zdGF0ZV9wcm9ncmFtOgogICAgaW50IDEKICAgIHJldHVybgo="
},
"state": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ def for_loop(self) -> FourArray:
for index, item in uenumerate(reversed(urange(4))): # [3, 2, 1, 0]
array[index] = arc4.UInt8(item)

for index in urange(4): # [0, 1, 2, 3]
array[index] = arc4.UInt8(index)
x = UInt64(0)

for item in urange(1, 5): # [1, 2, 3, 4]
x += item

assert x == 10

return array


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_for_loops(
txn_result = for_loop_app_client.for_loop()
print(f"for_loop result: {txn_result.return_value}")

assert txn_result.return_value == [0, 1, 2, 3]
assert txn_result.return_value == [3, 2, 1, 0]


def test_match_statements(
Expand Down

0 comments on commit 44b2461

Please sign in to comment.