aboutsummaryrefslogtreecommitdiff
path: root/2024
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-12-07 16:48:36 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-12-07 16:48:36 +0100
commitf891c9ed5cd9b0f5d112ef50fcb811789cc5d0cf (patch)
treed14860c88dced5525d2b12cd0ee7f89f46a6c0fe /2024
parent243fb1bb4deaea8d1bf6a95409f722816ca9f7a7 (diff)
Use a for-loop
Diffstat (limited to '2024')
-rw-r--r--2024/07/puzzles.awk5
1 files changed, 2 insertions, 3 deletions
diff --git a/2024/07/puzzles.awk b/2024/07/puzzles.awk
index 53b23d3..45597e9 100644
--- a/2024/07/puzzles.awk
+++ b/2024/07/puzzles.awk
@@ -5,9 +5,8 @@
# START PART 2
function pow(x, e, n)
{
- n = 1
- while (e--)
- n *= x
+ for (n = 1; e--; n *= x)
+ ;
return n
}
# END PART 2