Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: ASCII Battleship Program

by perlStuck (Sexton)
on Feb 04, 2012 at 15:25 UTC ( [id://951813]=note: print w/replies, xml ) Need Help??


in reply to Re: ASCII Battleship Program
in thread ASCII Battleship Program

Yeah, I think I found a partial solution at least. It would appear that two of the conditionals that would allow the return of a properly placed ship was faulty. In 'sub place_ship' there's a line that reads:

return 0 if $x<0 or $y<0 or $x>9 or $y>9;

Changing it to:

return 0 if $x<0 or $y<0 or $x>10 or $y>10;
That seems to work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://951813]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found