Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > Perl

Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 02-04-2007, 04:19 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 91
Rep Power: 7
KevinADC is on a distinguished road
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-05-2007, 02:13 PM
klumpi klumpi is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
Rep Power: 0
klumpi is on a distinguished road
Default

wow, there is a perl forum
I scripted a game in perl, tic tac toe if anyone is intrested send me a pm ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-05-2007, 09:20 PM
littlefranciscan
Guest
 
Posts: n/a
Default

A perl forum?What is the link of the link to your tic tac toe game? How long did it take to create?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-06-2007, 10:28 AM
klumpi klumpi is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
Rep Power: 0
klumpi is on a distinguished road
Default

#!/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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-06-2007, 02:14 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 91
Rep Power: 7
KevinADC is on a distinguished road
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #16 (permalink)  
Old 02-07-2007, 04:22 AM
klumpi klumpi is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
Rep Power: 0
klumpi is on a distinguished road
Default

Sorry, but he asked for it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 02-07-2007, 04:27 AM
littlefranciscan
Guest
 
Posts: n/a
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 02-07-2007, 02:35 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 91
Rep Power: 7
KevinADC is on a distinguished road
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 02-08-2007, 12:12 PM
xXHalfSliceXx's Avatar   
xXHalfSliceXx xXHalfSliceXx is offline
Co-Administrator
 
Join Date: Oct 2006
Location: Hendersonville, NC
Age: 24
Posts: 1,227
Rep Power: 20
xXHalfSliceXx is on a distinguished road
Send a message via AIM to xXHalfSliceXx Send a message via MSN to xXHalfSliceXx Send a message via Yahoo to xXHalfSliceXx
Default

Please stay on topic

Refer to Post 1
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Company
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 02-10-2007, 07:18 AM
priorityone
Guest
 
Posts: n/a
Default

So the topic was free perl tutorial.are there more out there?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: C# Hello World Jordan CSharp Tutorials 15 10-16-2008 11:44 PM
Perl is Dead. Long live Perl. Kernel Programming News 3 08-10-2007 11:49 AM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 04:05 PM
JSP Tutorial encoder JavaScript and CSS 0 05-26-2006 06:31 AM


All times are GMT -5. The time now is 05:36 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads