6

送给程序猿 / 程序媛们一段情人节的 PHP 代码[编程的日常]

 3 years ago
source link: https://zhuanlan.zhihu.com/p/56682042
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

送给程序猿 / 程序媛们一段情人节的 PHP 代码[编程的日常]

☑编程 ☑读书 ☑翻译 ☑太极

今天情人节,送给程序猿 / 程序媛们一段情人节的 PHP 代码。看不起 PHP 的就算了。

<?php
$sa = array_map(function (int $y) : string {
    return implode(array_map(function (int $x) use ($y) : string {
        return pow(pow($x * 0.05, 2) + pow($y * 0.1, 2) - 1, 3)
            - pow($x * 0.05, 2) * pow($y * 0.1, 3) <= 0
            ? str_split("LoveU")[$x - $y - floor(($x - $y) / 5) * 5]
            : " ";
    }, range(-30, 29)));
}, range(15, -14, -1));

array_walk($sa, function (string $s) {
    print($s . PHP_EOL);
});
v2-d27f995e5ce8ff90032d4219d652e36d_720w.png
编辑于 2019-02-14

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK