- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
private long tournamentId;
/**
* The winner takes it all
* The loser standing small
* Beside the victory
* That's her destiny
*/
private boolean theWinnerTakesItAll;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+73
private long tournamentId;
/**
* The winner takes it all
* The loser standing small
* Beside the victory
* That's her destiny
*/
private boolean theWinnerTakesItAll;
+162
function getCurrentTime( $isTimestamp = false )
{
if ( $isTimestamp ) {
return time();
} else {
return date( 'Y-m-d H:i:s' );
}
}
$timestamp = strtotime( getCurrentTime() );
$startDate = date( 'Y-m-d H:i:s', $timestamp );
+162
Vect2i nogi2head(int nX ,int nY,CSprite *sp,int Dest)
{
Vect2i tmp;
/*Dest=0;
switch (Dest)
{
case -1:
tmp.x=nX-sp->x;
break;
case 0:*/
tmp.x=nX-(sp->x)/2;
/*break;
case 1:
tmp.x=nX;
break;
}*/
tmp.y=nY-sp->y;
return tmp;
}
Даже не знаю, что тут сказать. Хохотал минут 10
+168
// преобразование из 12345 в 12 345
function ValueF($value) {
$temp=explode(".",$value);
for ($i_f=strlen($temp[0])-1, $i_f2=1; $i_f>=0; $i_f--, $i_f2++) {
$str.=$temp[0][$i_f];
if ($i_f2==3) {
$str.=" ";
$i_f2=0;
}
}
$str=strrev($str);
return $str;
}
2006 год
−123
@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!perl
#line 15
eval 'exec C:\TEMP\perl---please-run-the-install-script---\bin\perl.exe -S $0 ${1+"$@"}'
if $running_under_some_shell;
#!/usr/bin/perl
# $Id: cpan,v 1.9 2006/11/01 21:49:31 comdog Exp $
use strict;
+124
СLS
DEFLNG M-N,P,S
INPUT "N=";N
IF N>9.999999999999999D+48 THEN END
M=N
S=0
WHILE M<> 0
P=M MOD 10
S=S+P
M=M\10
PRINT "S=";S;
WEND
PRINT"P="; "S=";S;
PRINT
ЗДЕСЬ ВСЕ ВЕРНО ! СУММА ПОДСЧИТЫВАЕТСЯ ПРАВИЛЬНО. Часть 2 ЭТОЙ ЗАДАЧИ
WHILE S<>10
M=S: P=0
S1=0
WHILE M<>0
P=M MOD 10
S1=S1+P
M=M\10
PRINT S1
PRINT S1
WEND
PRINT"SUMMA=";S1
WEND
END
Это QBasic. Для числа подсчитываются сумма его цифр. Если результат превышает 9, то для результата снова подсчитывается сумма цифр и так далее, пока результат не станет меньше 10. Например, если исходное число 3247598, то результат 2. Взято отсюда: http://otvet.mail.ru/question/47598848/
+164
for(i = 0;;i++) {
tmpS[i]=cin.get();
if(tmpS[i] == '\n') {
i--;
break;
}
if(!isdigit(tmpS[i]))
i--;
}
...
for(k = 0; k < i; k++)
for(l =0; l < i; l++) {
tmp=t[l];
t[l]=t[l+1];
t[l+1]=tmp;
}
циклический сдвиг строки. Найдено у себя же.
+145
#ifndef __MUGCMediator_h_
#define __MUGCMediator_h_
namespace MUGClient{
class MUGCMediator{
public:
MUGCMediator(void);
~MUGCMediator(void);
MUGClient::MUGCApplication *getApplication(void);
bool operator+(MUGClient::MUGCApplication *arg);
//bool registerCameraController(MUGClient::MUGCCamera *arg);
protected:
MUGClient::MUGCApplication *clientApplication;
//MUGClient::MUGCCamera *clientCamera;
};
};
#endif
+145
#ifndef __MUGCApplication_h_
#define __MUGCApplication_h_
#include "MUGClient.h"
namespace MUGClient{
class MUGCApplication {
public:
MUGCApplication(void);
~MUGCApplication(void);
void go(void);
protected:
bool clientShutDown;
bool clientCursorWasVisible;
};
}
#endif
−166
/**
* Saving game state
* @return Boolean is game saved
*/
public static function saveCurrentProfileProgress():Boolean
{
if( defProfile != null )
{
var levelName:String;
var sceneName:String;
if( Module.getSingleton().getCurrentEpisode() )
{
if( Module.getSingleton().getCurrentEpisode() == Module.getSingleton().mEpisode1 )
{
levelName = "1";
}
else if( Module.getSingleton().getCurrentEpisode() == Module.getSingleton().mEpisode2 )
{
levelName = "2";
}
/**
* И так далее
*/
else if( Module.getSingleton().getCurrentEpisode() == Module.getSingleton().mEpisode24 )
{
levelName = "24";
}
else if( Module.getSingleton().getCurrentEpisode() == Module.getSingleton().mEpisode25 )
{
levelName = "25";
}
if( Module.getSingleton().getCurrentEpisode().getCurrentScene() )
{
if( Module.getSingleton().getCurrentEpisode().mScene1Window && Module.getSingleton().getCurrentEpisode().getCurrentScene() == Module.getSingleton().getCurrentEpisode().mScene1Window )
{
sceneName = "1";
}
else if( Module.getSingleton().getCurrentEpisode().mScene2Window && Module.getSingleton().getCurrentEpisode().getCurrentScene() == Module.getSingleton().getCurrentEpisode().mScene2Window )
{
sceneName = "2";
}
else if( Module.getSingleton().getCurrentEpisode().mScene3Window && Module.getSingleton().getCurrentEpisode().getCurrentScene() == Module.getSingleton().getCurrentEpisode().mScene3Window )
{
sceneName = "3";
}
else if( Module.getSingleton().getCurrentEpisode().mScene4Window && Module.getSingleton().getCurrentEpisode().getCurrentScene() == Module.getSingleton().getCurrentEpisode().mScene4Window )
{
sceneName = "4";
}
else if( Module.getSingleton().getCurrentEpisode().mScene5Window && Module.getSingleton().getCurrentEpisode().getCurrentScene() == Module.getSingleton().getCurrentEpisode().mScene5Window )
{
sceneName = "5";
}
}
}
if ( levelName != null && sceneName != null )
{
saveLevelName( levelName + "_" + sceneName );
return true;
}
}
return false;
}
Вот собсна и все