From db3d51ddc421dad68abddb95d01ffdab440197d6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 19 Mar 2023 03:24:43 +0900 Subject: feat(content): specify heading id --- .../php-conference-okinawa-code-golf/index.html | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html') diff --git a/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html b/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html index 0fb3911..6aa732d 100644 --- a/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html +++ b/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html @@ -76,8 +76,8 @@

-
-

+
+

細かいレギュレーションは不明だったので、勝手に定めた。

@@ -133,24 +133,24 @@ ?>]
-
-

使用したテクニック

-
-

指数表記

+
+

使用したテクニック

+
+

指数表記

割と多くの言語のゴルフで使えるテクニック。e を用いた指数表記で、大きな数を短く表す。このコードでは 10000500020001000 を指数表記している。

-
-

foreach や for の中身を1つの文に

+
+

foreach や for の中身を1つの文に

foreachforif などの後ろには、通常 { を続けて複数の文を連ねるが、中身の文を1つにしてしまえば、{} を省略できる。C言語などでも使える。

-
-

$r に初期値を入れない

+
+

$r に初期値を入れない

PHP では、$r[] = …​ のような配列の末尾に追加する式を実行したとき、$r が未定義だった場合は $r を勝手に定義して空の配列で初期化してくれる。これを利用すると、$r = []; のような初期化が不要になる。

@@ -164,8 +164,8 @@

-
-

PHP タグの外に文字列を置く

+
+

PHP タグの外に文字列を置く

PHP では、<?php ?> で囲われた部分の外側にある文字列は、そのまま出力される。今回のケースでは、先頭と末尾に必ず [] を出力するので、そのまま書いてやればよい。

-- cgit v1.2.3-70-g09d2