C'est en Ruby.
Code : Tout sélectionner
#!/usr/bin/env ruby
# Générateur de pseudo
# ©2009 Noé Rubinstein
# Permission vous est donnée de faire tout ce que vous voulez avec ce code. Cela inclut sans etre limité à:
# utiliser, éxécuter, copier, modifier, vendre, vendre des versions modifiées, construire des bombes avec.
def pileouface
rand(2) == 0
end
$decoration = ['o-', '_-', 'x', 'o_O ', '@@', '#', '~', 'xX', '..:']
$prefixe = %w(
dark
shadow
darth
the
ze
hell
hyper
super
kill
best
king
little
bad
pro
)
$radical = %w(
spinner
spin
angel
death
pen
shadow
spirit
power
le_boss
spinneur
penspinneur
lover
loveur
hokage
shinigami
killer
boy
girl
kill
thebest
)
class Array
def anyone
at(rand(length))
end
end
def generer( prefixe =true, decoration = true , postprocessing = true, addnumber = true)
pseudo = $radical.anyone
pseudo = $prefixe.anyone + ['_',' ','-','.', ''].anyone + pseudo if prefixe
if decoration
deco = $decoration.anyone
pseudo = deco + pseudo + deco.reverse
end
if postprocessing
pseudo.length.times do |i|
if pseudo[i] == ?s and rand(3) == 0
pseudo[i] = [?$, ?$, ?5].anyone
end
if pseudo[i] == ?a and rand(3) == 0
pseudo[i] = [?4, ?@].anyone
end
if pseudo[i] == ?e and rand(3) == 0
pseudo[i] = [?3].anyone
end
if pseudo[i] == ?o and rand(3) == 0
pseudo[i] = [?0].anyone
end
if pseudo[i] == ?i and rand(3) == 0
pseudo[i] = [?!, ?1].anyone
end
end
if pileouface # MiXeD CaSe
pseudo.length.times do |i|
pseudo[i] = pseudo[i,1].capitalize[0] if i % 2 == 1
end
end
end
if addnumber
pseudo = pseudo + rand(100).to_s
end
pseudo
end
100.times{
decoration = pileouface
puts generer( pileouface, decoration, true, (not decoration) && rand(2) == 0)
}
~darth-angel~
pRo$hAdOw27
@ngel78
hyp3r5hadow64
$pinneur40
xgirlx
tHe-sHaDoW8
_-@NgEl-_
pR0-sHiN!G4M!
l!tTl3.5h!nIgAmI12
0_O hell_girl O_0
shin1g4m1
..:LiTtLe_hOk@g3:..
o-tHeB3St-0
$pinn3ur2
zE-BoY
zE $p1nN3Ur
xXthe.killerXx
_-spin-_
boy32
tHeB3St98
o_O hOkAgE O_0
#penspinneur#
0-spirit-o
z3.@ngel88
k1ng.spirit41
hell @ngel88
xpenx
$PiNn3uR57
#l0v3ur#
le_bo$s
0-d3ath-o
sPiN
@@z3_boy@@
dark.k!ller50
sPiN
o-kIlL_ShIn1g4m1-O
p3nSpInN3Ur31
sh!n1g4m176
pow3r75
bAd_sH!N1G4M18
hokag3
dark-5P!N22
_-pen-_
hyp3r $PiNn3uR3
..:ze_$pirit:..
#Sp1rIt#
sPiN
xXdeathXx
ze boy65
o-b0y-0
..:k1ll:..
sH4DoW
zE-THEB3ST
kill_b0y26
pR0_sH4DoW
xXlOv3uRXX
p3nSpInN3Ur
#TH3B3ST#
xXtHe-sP1NXX
killer71
sH4DoW61
0_O $P!N O_0
kInGk!lL
o_O hyperkill O_0
b0y99
dArTh_lOvEr17
b0y
l0v3ur
@@sPiR!T@@
bAd kIlL5
xLe_bO$$x
xXb3$T_$PINN3URXx
@@pOw3r@@
xXkIlLXX
xloverx
@@hElL-GiRl@@
..:sh@d0w l0v3ur:..
0_O $PiNn3uR O_o
#super-pow3r#
#p0w3r#
sPiRiT
the-sh!n1g4m177
zE_$h!n1g4m1
dArTh_sH!N1G4M1
0-hyper.$PiNn3uR-o
sPiR!T91
xHyP3R_HoKaG3X
xXkillXx
$PiNn3uR
dEaTh
bE$T Sp1nN3R68
0_O ze sPiN O_o
darth tH3B3St47
p3nSpInN3Ur
#p3nSpInN3Ur#
0-lover-o
xp0w3rx
$H4DoW61
..:L0V3Ur:..