From 10ef70c467c2ee1c898e038edc4b8e8643a3d5e7 Mon Sep 17 00:00:00 2001 From: 2colours Date: Sun, 5 May 2024 03:27:47 +0200 Subject: PHP solutions for weeks 266 and 267 --- challenge-267/2colours/php/ch-1.php | 8 ++++++++ challenge-267/2colours/php/ch-2.php | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 challenge-267/2colours/php/ch-1.php create mode 100644 challenge-267/2colours/php/ch-2.php (limited to 'challenge-267/2colours/php') diff --git a/challenge-267/2colours/php/ch-1.php b/challenge-267/2colours/php/ch-1.php new file mode 100644 index 0000000000..8b6b877a8a --- /dev/null +++ b/challenge-267/2colours/php/ch-1.php @@ -0,0 +1,8 @@ + $acc * gmp_sign($current), 1); +} + +echo 'The sign of the product is ' . sign_of_product(array_slice($argv, 1)); diff --git a/challenge-267/2colours/php/ch-2.php b/challenge-267/2colours/php/ch-2.php new file mode 100644 index 0000000000..c824e95eea --- /dev/null +++ b/challenge-267/2colours/php/ch-2.php @@ -0,0 +1,26 @@ + SCREEN_WIDTH) { + echo "Line $current_line_number: $current_line_content ($current_column pixels)\n"; + $current_line_content = "$current_char"; + $current_column = $current_width; + $current_line_number++; + continue; + } + $current_column += $current_width; + $current_line_content .= $current_char; +} +echo "Line $current_line_number: $current_line_content ($current_column pixels)"; \ No newline at end of file -- cgit