Skip to content

Instantly share code, notes, and snippets.

@HarryR
Last active December 27, 2015 05:08
Show Gist options
  • Select an option

  • Save HarryR/7271387 to your computer and use it in GitHub Desktop.

Select an option

Save HarryR/7271387 to your computer and use it in GitHub Desktop.
/r/shittyprogramming fizz buzz competition entry
<?php
// CPOYRIGHT (C) 1989 ACCESODATA CORPORATION ES.
// AUTHOR: RDRGO.43
// DEPART: ENGINEERING
// PROJEC: INSURANCE DATA VERIFICACION
/* 0001 */ // DEFINE('
/* 0002 */ FOREACH( RANGE(1,100) AS $NUMERO )
/* 0003 */ {
/* 0004 */ // IS NUMERO FOR BUZZ?
/* 0005 */ $DIVTRES = (string)($NUMERO / 3);
/* 0006 */ IF( STRSTR($DIVTRES, ".") !== FALSE )
/* 0008 */ $$NUMERO = $$NUMERO . ' Fizz ';
/* 0010 */
/* 0011 */ // IS NUMERO FOR BUZZ?
/* 0012 */ $DIVSIETE = (string)($NUMERO / 7);
/* 0013 */ IF( STRSTR($DIVSIETE, ".") !== FALSE )
// CODE REMOVED DUE TO SECURITY CONCERNS
/* 0019 */ $$NUMERO = $$NUMERO . ' Buzz ';
/* 0021 */
/* 0022 */ // MANY GAP IN THE STRING
/* 0023 */ WHILE( TRUE )
/* 0024 */ {
/* 0025 */ $REEMPLAZADO = STR_REPLACE(" ", " ", $$NUMERO);
/* 0026 */ IF( $REEMPLAZADO == $$NUMERO ) {
/* 0027 */ BREAK;
/* 0028 */ }
/* 0029 */ $$NUMERO = $REEMPLAZADO;
/* 0029 */ }
/* 0030 */ PRINT "{$NUMERO} = {$$NUMERO}\r\n";
/* 0031 */ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment