Admin Garm217

Perl Dancer + Browser Game

Now i am learning Perl and writing browser game with Perl::Dancer.

You can find my game at my repo in GitHub.

But i want to upload my Perl part of prog. (no html web code)

i am sorry. because a lot of text from my game was translated by Google translate very bad, so i del some phrases. in future i will translate it in english.

you need to guess the number. from 1 to 100.

and PC will tell you some tips. and original code

#! / Usr / bin / perl-w
use strict;

my $ time_start = (time);
my @ very_cold = (
"[It’s cold] You killed Kenny."
"[It’s cold] Do not waste my time loser."
"[It’s cold] After five unsuccessful attempts to your PC will be offended and leave."
"[It’s cold] Critical Error.",
"[It’s cold] O Rly.",
"[It’s cold] WTF!?",
"[It’s cold] 1,2,3,4,5 Freddy Pszczel you seek."
"[It’s cold] You should not have it. In vain, in vain, in vain."
"[It’s cold] You’re just like the Romanian special forces, not only Romanians."
"[It’s cold] Again, this was the answer will come to you and Justin Bieber."
"[It’s cold] You go to Narnia with this intuition."
"[It’s cold] And you play like chumachechy din from the coolness of code you speechless."
"[It’s cold] Ubeysya the wall."
"[It’s cold] On the box with headphones shows a beautiful, quiet, blue-eyed girl. Why not show her ruffled, tousled, with bloodshot eyes, while she tried these headphones ****** out of the box sealed get it?"
);

my @ cold = (
"[Cold] Google to help."
"[Cold] Do you need help from the audience."
"[Cold] watching you heifer. Profukannyh Not a chance."
"[Cold] cat Behemoth will punish you."
"[Cold] Uchu Angiysky with the first class. Learned the three words - What The Fuck.",
"[Cold] This is SPARTA!!! 1"
"[Cold] Play only Nerdam or to whom nefig do."
"[Cold] You’re Shit and Shit must shout louder."
);
my @ hot = (
"[Hot] Yes you straight Legolas - accurate to the eye."
"[Hot] you protect yourself bearded man."
"[Hot] Me Gusta.",
"[Hot] I answered, frankly, you’re not, so it will have to think you might."
"[Hot] Luke, I am your father."
"[Hot] Yes you even ravioli are afraid, do not dare to float and stay together,"
);
my @ very_hot = (
"[Very Hot] Holy Dzhygurda, yes you’re Batman."
"[Very Hot] anchor me in the ass, but you’re David Blaine."
"[Very Hot] Fucking Iodine. Even Sheldon did not respond would have been better."
"[Very Hot] Headshot.",
"[Very Hot] Godlike.",
"[Very Hot] That you straight sinhrofazatrona inventor."
"[Very Hot] Even Chuck Noris is afraid of you."
"[Very Hot] I want your children."
"[Very Hot] All heifers are yours."
"[Very Hot] Mankind will not remain forever on Earth, but in pursuit of light and space at first timidly penetrate beyond the atmosphere, and then win all the space around the sun. - Konstantin E. Tsiolkovsky. ‘
);


my $ rnum = int (rand (100));
print “$ rnum \ n”;
print “guess the number 
from 1 to 100. \ n”;
my $ dif = 1;
while ($ dif) {
chomp (my $ line = <STDIN>);
if (! ($ line = ~ m / \ D /) & & $ line <= 100 & & $ line> = 1) {
$ Dif = abs ($ line - $ rnum);
if (($ dif> 50) & & ($ dif <100)) {
    
my $ x = int (rand (scalar @ very_cold));
    
print $ very_cold [$ x], “\ n”;
    
} Elsif (($ dif> 30) & & ($ dif <= 50)) {
    
my $ x = int (rand (scalar @ cold));
    
print $ cold [$ x], “\ n”;
    
} Elsif (($ dif> 10) & & ($ dif <= 30)) {
    
my $ x = int (rand (scalar @ hot));
    
print $ hot [$ x], “\ n”;
    
} Elsif (($ dif> 0) & & ($ dif <= 10)) {
    
my $ x = int (rand (scalar @ very_hot));
    
print $ very_hot [$ x], “\ n”;
    
} Else {
    
print “You’re Just Cool Men =)  A lot many of time gone, but the number is $ rnum \ n”;
    
};
} Else {print “I do not understand you \ n”};
}

print “Your Time”, ((time) - $ time_start), “seconds (s) \ n”;


  1. garm217 posted this
To Tumblr, Love PixelUnion