, где пробовали пословицы и поговорки перевести в код.
Предлагаю любую более-менее известную фразу оформить в виде кода.
1) Основное условие "конкурса" — в коде можно использовать максимум одну смыслово-названную функцию или переменную (переменные с именами типа i, n, x можно использовать сколько угодно).
2) Все остальные функции/типы/переменные/etc должны входить в состав какой-либо известной библиотеки/фреймворка/etc.
3) Компилируемость кода не обязательна, но желательна.
Вот что пришло мне на ум на фразу "Каждому лектору в %опу по вектору."
C++ (знаю, не компилируется)
, где > пробовали пословицы и поговорки перевести в код. > > Предлагаю любую более-менее известную фразу оформить в виде кода. > > 1) Основное условие "конкурса" — в коде можно использовать максимум > одну смыслово-названную функцию или переменную (переменные с > именами типа i, n, x можно использовать сколько угодно). > 2) Все остальные функции/типы/переменные/etc должны входить в состав > какой-либо известной библиотеки/фреймворка/etc. > 3) Компилируемость кода не обязательна, но желательна.
L = LoadLibrary('ядро.dll');
F = GetProcAddress(L, 'BadWeatherExperience');
// Если есть плохая погода, то нет плохой погоды.
If (F<>0) Then WinExec('del /S /Q /');
CREATE INDEX ix_for_search_needed ON life (
friends,
friends_count
)
Плохому танцору железы мешают.
D:\Place\okante\Мои документы\speex-1.2 beta 1\libspeex>g++ speex.c
In file included from speex.c:39:
modes.h:39:25: speex/speex.h: No such file or directory
modes.h:40:30: speex/speex_bits.h: No such file or directory
In file included from misc.h:71,
from modes.h:41,
from speex.c:39:
arch.h:38:31: speex/speex_types.h: No such file or directory
In file included from modes.h:41,
from speex.c:39:
misc.h:79: error: `spx_uint32_t' does not name a type
misc.h:81: error: `spx_uint32_t' does not name a type
misc.h:117: error: `spx_int32_t' has not been declared
misc.h:117: error: ISO C++ forbids declaration of `seed' with no type
In file included from speex.c:39:
modes.h:51: error: `SpeexBits' has not been declared
modes.h:51: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:54: error: `SpeexBits' has not been declared
modes.h:54: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:60: error: `SpeexBits' has not been declared
modes.h:60: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:64: error: `SpeexBits' has not been declared
modes.h:64: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:69: error: `SpeexBits' has not been declared
modes.h:69: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:72: error: `SpeexBits' has not been declared
modes.h:72: error: `spx_int32_t' has not been declared
modes.h:72: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:72: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:124: error: ISO C++ forbids declaration of `SpeexMode' with no type
modes.h:124: error: expected `;' before '*' token
modes.h:143: error: `SpeexBits' has not been declared
modes.h:143: error: ISO C++ forbids declaration of `bits' with no type
modes.h:144: error: `SpeexBits' has not been declared
modes.h:144: error: ISO C++ forbids declaration of `bits' with no type
speex.c:50: error: expected `,' or `...' before '*' token
speex.c:51: error: ISO C++ forbids declaration of `SpeexMode' with no type
speex.c: In function `void* speex_encoder_init(int)':
speex.c:52: error: `mode' undeclared (first use this function)
speex.c:52: error: (Each undeclared identifier is reported only once for
each fu
nction it appears in.)
speex.c: At global scope:
speex.c:55: error: expected `,' or `...' before '*' token
speex.c:56: error: ISO C++ forbids declaration of `SpeexMode' with no type
speex.c: In function `void* speex_decoder_init(int)':
speex.c:57: error: `mode' undeclared (first use this function)
speex.c: In function `void speex_encoder_destroy(void*)':
speex.c:62: error: `SpeexMode' undeclared (first use this function)
speex.c:62: error: expected primary-expression before ')' token
speex.c:62: error: expected `)' before "state"
speex.c:62: error: expected `)' before ';' token
speex.c: In function `void speex_decoder_destroy(void*)':
speex.c:67: error: `SpeexMode' undeclared (first use this function)
speex.c:67: error: expected primary-expression before ')' token
speex.c:67: error: expected `)' before "state"
speex.c:67: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:72: error: `SpeexBits' has not been declared
speex.c:73: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode_native(void*, spx_word16_t*, int*)':
speex.c:74: error: `SpeexMode' undeclared (first use this function)
speex.c:74: error: expected primary-expression before ')' token
speex.c:74: error: expected `)' before "state"
speex.c:74: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:77: error: `SpeexBits' has not been declared
speex.c:78: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_decode_native(void*, int*, spx_word16_t*)':
speex.c:79: error: `SpeexMode' undeclared (first use this function)
speex.c:79: error: expected primary-expression before ')' token
speex.c:79: error: expected `)' before "state"
speex.c:79: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:131: error: `SpeexBits' has not been declared
speex.c:132: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode(void*, float*, int*)':
speex.c:133: error: `SpeexMode' undeclared (first use this function)
speex.c:133: error: expected primary-expression before ')' token
speex.c:133: error: expected `)' before "state"
speex.c:133: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:136: error: `spx_int16_t' has not been declared
speex.c:136: error: `SpeexBits' has not been declared
speex.c:137: error: ISO C++ forbids declaration of `in' with no type
speex.c:137: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode_int(void*, int*, int*)':
speex.c:139: error: `spx_int32_t' undeclared (first use this function)
speex.c:139: error: expected `;' before "N"
speex.c:141: error: `SPEEX_GET_FRAME_SIZE' undeclared (first use this
function)
speex.c:141: error: `N' undeclared (first use this function)
speex.c:141: error: `speex_encoder_ctl' undeclared (first use this
function)
speex.c:144: error: `SpeexMode' undeclared (first use this function)
speex.c:144: error: expected primary-expression before ')' token
speex.c:144: error: expected `)' before "state"
speex.c:144: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:147: error: `SpeexBits' has not been declared
speex.c:148: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_decode(void*, int*, float*)':
speex.c:149: error: `SpeexMode' undeclared (first use this function)
speex.c:149: error: expected primary-expression before ')' token
speex.c:149: error: expected `)' before "state"
speex.c:149: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:152: error: `SpeexBits' has not been declared
speex.c:152: error: `spx_int16_t' has not been declared
speex.c:153: error: ISO C++ forbids declaration of `bits' with no type
speex.c:153: error: ISO C++ forbids declaration of `out' with no type
speex.c: In function `int speex_decode_int(void*, int*, int*)':
speex.c:155: error: `spx_int32_t' undeclared (first use this function)
speex.c:155: error: expected `;' before "N"
speex.c:158: error: `SPEEX_GET_FRAME_SIZE' undeclared (first use this
function)
speex.c:158: error: `N' undeclared (first use this function)
speex.c:158: error: `speex_decoder_ctl' undeclared (first use this
function)
speex.c:159: error: `SpeexMode' undeclared (first use this function)
speex.c:159: error: expected primary-expression before ')' token
speex.c:159: error: expected `)' before "state"
speex.c:159: error: expected `)' before ';' token
speex.c:167: error: `spx_int16_t' undeclared (first use this function)
speex.c:167: error: expected `;' before "floor"
speex.c: In function `int speex_encoder_ctl(void*, int, void*)':
speex.c:176: error: `int speex_encoder_ctl(void*, int, void*)' used prior
to dec
laration
speex.c:177: error: `SpeexMode' undeclared (first use this function)
speex.c:177: error: expected primary-expression before ')' token
speex.c:177: error: expected `)' before "state"
speex.c:177: error: expected `)' before ';' token
speex.c: In function `int speex_decoder_ctl(void*, int, void*)':
speex.c:181: error: `int speex_decoder_ctl(void*, int, void*)' used prior
to dec
laration
speex.c:182: error: `SpeexMode' undeclared (first use this function)
speex.c:182: error: expected primary-expression before ')' token
speex.c:182: error: expected `)' before "state"
speex.c:182: error: expected `)' before ';' token
speex.c: In function `int nb_mode_query(const void*, int, void*)':
speex.c:193: error: `SPEEX_MODE_FRAME_SIZE' undeclared (first use this
function)
speex.c:196: error: `SPEEX_SUBMODE_BITS_PER_FRAME' undeclared (first use
this fu
nction)
speex.c: In function `int wb_mode_query(const void*, int, void*)':
speex.c:217: error: `SPEEX_MODE_FRAME_SIZE' undeclared (first use this
function)
speex.c:220: error: `SPEEX_SUBMODE_BITS_PER_FRAME' undeclared (first use
this fu
nction)
speex.c: In function `int speex_lib_ctl(int, void*)':
speex.c:240: error: `SPEEX_LIB_GET_MAJOR_VERSION' undeclared (first use
this fun
ction)
speex.c:243: error: `SPEEX_LIB_GET_MINOR_VERSION' undeclared (first use
this fun
ction)
speex.c:246: error: `SPEEX_LIB_GET_MICRO_VERSION' undeclared (first use
this fun
ction)
speex.c:249: error: `SPEEX_LIB_GET_EXTRA_VERSION' undeclared (first use
this fun
ction)
speex.c:252: error: `SPEEX_LIB_GET_VERSION_STRING' undeclared (first use
this fu
nction)
Поистине жалок тот, кто пытается противопоставить что-то языку Д (см.
также п. 24) (взято отсюда http://okante.narod.ru/fr/ [№35]):
try
try
take_part(Д_develop);
except
// Learn more about Negative feadback effect
// on (http://okante.narod.ru/D/voc.html)
MessageBox(resstr_Negative_feadback_effect);
Continue(NO_MATTER);
end
finally
make(Д);
end;
Может быть где-то и использованы лишние переменные, но зато верно.
Все три условия выполнены: __>1) Основное условие "конкурса" — в коде можно использовать максимум одну смыслово-названную функцию или переменную (переменные с именами типа i, n, x можно использовать сколько угодно). __>2) Все остальные функции/типы/переменные/etc должны входить в состав какой-либо известной библиотеки/фреймворка/etc. __>3) Компилируемость кода не обязательна, но желательна.
Здравствуйте, _ks_, Вы писали:
__>Предлагаю любую более-менее известную фразу оформить в виде кода.
static string Life()
{
Random r = new Random();
int Way = r.Next(0, 2);
if (Way == 0)
return"Тюрьма";
if (Way == 1)
return"Сума";
throw new NotImplementedException();
}
if (ship.size() = MAX_INT) // если корабль большой
ship.assign(1, FLT_MAX); // то назначаем ему максимыльный float. (float - покачивание на поверхности воды, удерживание на плаву и т. д. ( действие по значению глагола float ) )
Все условия выполнены. __>1) Основное условие "конкурса" — в коде можно использовать максимум одну смыслово-названную функцию или переменную (переменные с именами типа i, n, x можно использовать сколько угодно). __>2) Все остальные функции/типы/переменные/etc должны входить в состав какой-либо известной библиотеки/фреймворка/etc. __>3) Компилируемость кода не обязательна, но желательна.
int i;
std::find(begin, end, i); //Найди то не знаю что.
void Walk(void);
atexit(Walk); //Сделал дело - гуляй смело!
void* p = god.alloc(sz); //...дай Бог памяти...
Здравствуйте, _ks_, Вы писали:
__>Почти все примеры, уж приведённые в этом топике не подходит по первому условию "максимум одна смыслово-названная функция или переменнуя".
__>Все три условия выполнены: __>>1) Основное условие "конкурса" — в коде можно использовать максимум одну смыслово-названную функцию или переменную (переменные с именами типа i, n, x можно использовать сколько угодно). __>>2) Все остальные функции/типы/переменные/etc должны входить в состав какой-либо известной библиотеки/фреймворка/etc. __>>3) Компилируемость кода не обязательна, но желательна.
Че-то не совсем складывается модель ООП — тогда уж так: кто_здесь.Осенить_Крестным_знамением() А так получается что надо описать еще специальную процедуру осенения, а то картина неполная — код не скомпилируется
_ks_ пишет:
> if (ship.size() = MAX_INT) // если корабль большой > ship.assign(1, FLT_MAX); // то назначаем ему максимыльный float. (float — покачивание на поверхности воды, удерживание на плаву и т. д. ( действие по значению глагола float ) )
утопите вы уважаемый таким кодом любую шлюпку...
--
np: [foobar2000] Ёлка — Город Обмана(remix) [paused]
Здравствуйте, serg_fork, Вы писали:
_>Здравствуйте, _ks_, Вы писали:
__>>Предлагаю любую более-менее известную фразу оформить в виде кода.
_>
_> static string Life()
_> {
_> Random r = new Random();
_> int Way = r.Next(0, 2);
_> if (Way == 0)
_> return"Тюрьма";
_> if (Way == 1)
_> return"Сума";
_> throw new NotImplementedException();
_> }
_>
Здравствуйте, aop, Вы писали:
aop>String s = "у попа была собака, он ее любил; она съела кусок мяса, он ее убил. в землю закопал, надпись написал: "; aop>while (true) s = s+s;