s*****m 发帖数: 8094 | 1 没什么复杂的,
def IsFemale(appearance, genital):
return LooksLikeFemale(appearance) and DefinedAsFemale(genital)
def IsMale(appearance, genital, gay):
return LooksLikeMale(appearance) and DefinedAsMale(genital) and not gay
def Abnormal(appearance, genital, gay):
return not IsFemale(appearance, genital) and not IsMale(appearance,
genital, gay) |
|
发帖数: 1 | 2 要求写一个类,完成template string功能。具体如下:
var tmp = Template("{name} is a {if #isMale}man{/if}.")
tmp.format({name:'John', isMale:false})
这样就会输出 John is a man.
要实现的东西有3层:
1. Variable replacement
2. If statement
3. Nested if statement |
|
f****4 发帖数: 1359 | 3 if (!坑)
{
Bless LZ找到下家;
errno = LZ_老婆_有毛病;
return;
}
else
{
if (!is人妖(LZ))
remove_DNA_from(LZ, isMale(LZ) ? 精子 : 卵细胞);
else
set_人妖_下辈子_to(LZ);
while (true)
{
被强奸100遍();
}
} |
|
l*r 发帖数: 79569 | 4 直接isMale?
看return value ... |
|