Last active
August 29, 2015 14:22
-
-
Save CosmoCleaner/5c5e2b1f947e4b978a24 to your computer and use it in GitHub Desktop.
キャリッジ・リターンを使ったありがちなプログレスアニメーション
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$i = 0; | |
while(true){ | |
$phase = $i % 8; | |
switch($phase){ | |
case 0: | |
case 4: | |
echo "\r|"; | |
break; | |
case 1: | |
case 5: | |
echo "\r/"; | |
break; | |
case 2: | |
case 6: | |
echo "\r-"; | |
break; | |
case 3: | |
case 7: | |
echo "\r\\"; | |
break; | |
default: | |
break; | |
} | |
$i++; | |
usleep(500000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment