Closed Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Perl Tutorial Course for Windows

  1. #11
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    Quote Originally Posted by priorityone View Post
    There is nothing wrong with starting with a basic Perl course then proceeding to a more intense study of the topic.
    I agree. I would say it's the best way. My comment was about the "free course" you posted a link to, and only that. My apology if I sounded too critical of your post. I am sure people will find it useful as a tool to learn basic perl and cgi progamming.

    Regards,
    Kevin

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #12
    klumpi is offline Newbie
    Join Date
    Feb 2007
    Posts
    5
    Rep Power
    0
    wow, there is a perl forum
    I scripted a game in perl, tic tac toe if anyone is intrested send me a pm

  4. #13
    littlefranciscan Guest
    A perl forum?What is the link of the link to your tic tac toe game? How long did it take to create?

  5. #14
    klumpi is offline Newbie
    Join Date
    Feb 2007
    Posts
    5
    Rep Power
    0
    #!/usr/local/bin/perl

    use strict;
    use warnings;


    ################################################## #############################################
    # Created by Klumpi #
    # #
    # Italy/South Tirol #
    # #
    # #
    # # #
    # #
    # #
    # # #
    ################################################## #############################################

    # Output imediatly
    $|=1;

    my $A1;
    my $A2;
    my $A3;
    my $B1;
    my $B2;
    my $B3;
    my $C1;
    my $C2;
    my $C3;
    my $X;
    my $O;


    #
    #Zuweisung der Felder den Koordinaten!
    #


    $A1="Feld1";
    $A2="Feld2";
    $A3="Feld3";
    $B1="Feld4";
    $B2="Feld5";
    $B3="Feld6";
    $C1="Feld7";
    $C2="Feld8";
    $C3="Feld9";

    my $AMOGLICHKEITEN;
    my $EINGABE=1;

    #
    #"Grafischer" Programmstart mit Entwicklung, Gebung der Namen und Auswahl des
    #Spielers "X" oder "O"
    #

    print "Welcome to Tic Tac Toe created by Klumpi WARNING:Es kann zu Fehlern
    w?§hrend des Spiels kommen!!\n";
    print "Ok, lets begin\n";
    print "What's your name?\n";
    chomp(my $name= <STDIN>);
    print "Hi, $name\n";
    print "What would you like to be?\n";
    print "X or O\n";
    $AMOGLICHKEITEN= <STDIN>;
    chomp $AMOGLICHKEITEN;
    $AMOGLICHKEITEN =~ tr/a-z/A-Z/;

    my $Player;
    my $CPU;

    do
    {
    if ($AMOGLICHKEITEN eq "X")
    {
    $Player = "X";
    $CPU = "O";
    }

    elsif ($AMOGLICHKEITEN eq "O")
    {
    $Player = "O";
    $CPU = "X";
    }
    else
    {
    print "Wrong input (X or O): ";
    $AMOGLICHKEITEN= <STDIN>;
    chomp $AMOGLICHKEITEN;
    $AMOGLICHKEITEN =~ tr/a-z/A-Z/;
    }
    }
    until (defined $Player);

    print "Ok, you are $Player\n";
    print "lets begin now, pick out between this capabilities\n\n";


    #
    #Schreiben der Felder im Skript mit Koords.
    #


    format STDOUT =
    @||||| | @|||||| | @||||||
    $A1, $B1, $C1,
    --------------------------
    @||||| | @|||||| | @||||||
    $A2, $B2, $C2,
    --------------------------
    @||||| | @|||||| | @||||||
    $A3, $B3, $C3
    .
    write;

    print "\n";

    #
    #In der While Schleife spielt sich alles ab. Von der erweiterten Gebung der
    #Zeilen bis hin zum Case Statement mit den
    #verschiedenen Moglichkeiten zum Sieg zu gelange. Die einzelnen Zügeund
    #dessen Moglichkei derinerseits und
    #gegenuber des CPU
    #

    my @Feld;
    my $rand;


    while (1)
    {
    SWITCH:
    {
    chomp($EINGABE = <STDIN>);

    my @felder = qw(Feld1 Feld2 Feld3 Feld4 Feld5 Feld6 Feld7 Feld8 Feld9);
    my @ref = (\$A1, \$A2, \$A3, \$B1, \$B2, \$B3, \$C1, \$C2, \$C3);
    my $i = 0;

    unless ($EINGABE =~ /Feld(1|2|3|4|5|6|7|8|9)/)
    {
    print "Wrong input: ";
    chomp($EINGABE = <STDIN>);
    }

    foreach (@felder)
    {
    if ($EINGABE eq "$_" )
    {
    print "$i.Durchgang: ${$ref[$i]}\n";
    if (${$ref[$i]} eq "$_") #dereferenzieren der Referenzen in @ref
    {
    ${$ref[$i]} = $AMOGLICHKEITEN;
    print "Choice: $_\n";
    last SWITCH;
    }
    else
    {
    print "Noob, already used!! ";
    goto SWITCH;
    }
    }
    $i++;
    }
    } #SWITCH Ende

    &finish();

    print "Now the computer is moving";

    for (my $i=0;$i<5;$i++) { print ". "; sleep 1; }

    print "\n";

    &compmove;

    #
    #Das Drucken der aktualisierten Felder mit den X und O Variablen
    #

    print "\n";
    write;
    print "\n";

    }
    #
    #Die If Schleifen die dan bekannt geben wenn du gewonnen hast oder der CPU
    #Auf die If Schleife wird wie Vorhergesehen mit den elsif "geantwortet"
    #Sollte das Spiel entschieden sein und der Sieger festliegt,
    #steigt das Programm mit den Befehl im unteren Teil= exit 0 aus.
    #

    &finish();

    sub finish
    {
    if ($A1 eq "X" && $A2 eq "X" && $A3 eq "X") {
    print "X wins\n";
    exit 0;}
    elsif ($B1 eq "X" && $B2 eq "X" && $B3 eq "X") {
    print "X WINS \n";
    exit 0;}
    elsif ($C1 eq "X" && $C2 eq "X" && $C3 eq "X") {
    print "X WINS\n";
    exit 0;}
    elsif ($A1 eq "X" && $B1 eq "X" && $C1 eq "X") {
    print "X WINS\n";
    exit 0;}
    elsif ($A2 eq "X" && $B2 eq "X" && $C2 eq "X") {
    print "X WINS\n";
    exit 0;}
    elsif ($A3 eq "X" && $B3 eq "X" && $C3 eq "X") {
    print "X WINS\n";
    exit 0;}
    elsif ($A1 eq "X" && $B2 eq "X" && $C3 eq "X") {
    print "X WINS!!\n";
    exit 0;}
    elsif ($C1 eq "X" && $B2 eq "X" && $A3 eq "X") {
    print "X WINS!!\n";
    exit 0;}

    #
    #Die if Schleifen die angeben ob der Computer gewonnen hat oder auch nicht
    #

    if ($A1 eq "O" && $A2 eq "O" && $A3 eq "O") {
    print "O wins\n";
    exit 0;}
    elsif ($B1 eq "O" && $B2 eq "O" && $B3 eq "O") {
    print "O WINS \n";
    exit 0;}
    elsif ($C1 eq "O" && $C2 eq "O" && $C3 eq "O") {
    print "O WINS\n";
    exit 0;}
    elsif ($A1 eq "O" && $B1 eq "O" && $C1 eq "O") {
    print "O WINS\n";
    exit 0;}
    elsif ($A2 eq "O" && $B2 eq "O" && $C2 eq "O") {
    print "O WINS\n";
    exit 0;}
    elsif ($A3 eq "O" && $B3 eq "O" && $C3 eq "O") {
    print "O WINS\n";
    exit 0;}
    elsif ($A1 eq "O" && $B2 eq "O" && $C3 eq "O") {
    print "O WINS!!\n";
    exit 0;}
    elsif ($C1 eq "O" && $B2 eq "O" && $A3 eq "O") {
    print "O WINS!!\n";
    exit 0;}
    }


    #
    #Sub ist der Pseudoalgorythmus der in Tic Tac Toe den Gegner simuliert.
    #

    sub compmove
    {
    my $gefunden = 0;
    do
    {
    @Feld = (\$A1, \$A2, \$A3, \$B1, \$B2, \$B3, \$C1, \$C2, \$C3);
    $rand= int(rand 9);
    unless (${$Feld[$rand]} eq "X" || ${$Feld[$rand]} eq "O")
    {
    print "CPU: ${$Feld[$rand]}\n";
    ${$Feld[$rand]} = $CPU;
    $gefunden = 1;
    }
    }
    until ($gefunden == 1);
    }


    It's an older script! and the most of it is in german
    Sorry, my Englisch is not the best

  6. #15
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    it's not really nice of you to "hijack" this thread. You could have started a new thread if you wanted to share your tic-tac-toe script. This thread is about a perl tutorial.

  7. #16
    klumpi is offline Newbie
    Join Date
    Feb 2007
    Posts
    5
    Rep Power
    0
    Sorry, but he asked for it

  8. #17
    littlefranciscan Guest
    Thanks for posting that..and I don't mind that you posted in my thread since my question initiated your response..Keep up the good work

  9. #18
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    Quote Originally Posted by littlefranciscan View Post
    Thanks for posting that..and I don't mind that you posted in my thread since my question initiated your response..Keep up the good work
    I thought "priorityone" started the thread.

  10. #19
    Join Date
    Oct 2006
    Location
    Hendersonville, NC
    Posts
    1,700
    Blog Entries
    3
    Rep Power
    0
    Please stay on topic

    Refer to Post 1


  11. #20
    priorityone Guest
    So the topic was free perl tutorial.are there more out there?

Closed Thread
Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2011, 02:31 PM
  2. C# Tutorial: Obtaining Windows User Details
    By rueleonheart in forum CSharp Tutorials
    Replies: 4
    Last Post: 10-23-2010, 11:10 PM
  3. Open multiple windows in Perl Tk
    By terrylau in forum Perl
    Replies: 1
    Last Post: 09-15-2009, 05:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts