From f891c9ed5cd9b0f5d112ef50fcb811789cc5d0cf Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 7 Dec 2024 16:48:36 +0100 Subject: Use a for-loop --- 2024/07/puzzles.awk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '2024/07/puzzles.awk') 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 -- cgit v1.2.3