Posted: Tue Jan 20, 2004 10:38 pm Post subject: (No subject)
bravo!!!! That is very well done, for not using any graphics (like drawn graphics using paint etc). If thats your final project you will get a pretty damn good mark!
TheXploder
Posted: Thu Jan 22, 2004 10:10 am Post subject: (No subject)
thanx, any more comments or suggestions?
we64
Posted: Tue Jan 27, 2004 6:36 pm Post subject: (No subject)
great program, well done...
I would like to see it with graphics, that will be so cool...
shorthair
Posted: Thu Jan 29, 2004 12:07 pm Post subject: (No subject)
Awsome job , get the graphics and i throw in some BITS , keep up hte good code , reminds me of my battleship game , my was alot messier than yours
sport
Posted: Thu Jan 29, 2004 12:23 pm Post subject: (No subject)
Great Program.
Paul
Posted: Thu Jan 29, 2004 12:26 pm Post subject: (No subject)
And to think... I was a part of it...
*gets glares from everyone*
I WAS part of the testing!!!
TheXploder
Posted: Thu Jan 29, 2004 12:36 pm Post subject: (No subject)
But don't you think the AI is well how do you put it in the right words, STUPID, , Gotta fix that I guess.
so lets say the 2 place sip is located here as a '1':
|0|0|0|0|
|0|1|1|0|
|0|0|0|0|
and then the computer hits it and then the '1' is replaced by an 'x':
|0|0|0|0|
|0|x|1|0|
|0|0|0|0|
*so now the next random procces should only randomly choose to go up, left, right, or down...
when it misses the next turn and chooses wrong, the old cordinate should be retreated and randomly choose again...
Thats my problem right now... And imagine 3 place ships..
Graphics are easy game... (Just need to draw them)
Sponsor Sponsor
Paul
Posted: Thu Jan 29, 2004 1:02 pm Post subject: (No subject)
So once it hits something, it has to store that co-ordinate and hit next to it?
TheXploder
Posted: Thu Jan 29, 2004 1:28 pm Post subject: (No subject)
yes something like that, ohh, let's make a quick program to simulate the placement.. here..:
code:
var lengthOfArray : int := 10
var map : array 1 .. lengthOfArray, 1 .. lengthOfArray of int
for row : 1 .. lengthOfArray
for col : 1 .. lengthOfArray
map (row, col) := 0
end for
end for
var x : int := Rand.Int (1, 5)
var y : int := Rand.Int (1, 5)
var sizeOfShip : int := Rand.Int (1, 4)
var direction : int := Rand.Int (0, 1)
proc ship (x, y, size, dir : int)
if dir = 1 and size = 1 then
map (x, y) := 1
elsif dir = 0 and size = 1 then
end if
if dir = 1 and size = 2 then
map (x, y) := 1
map (x, y + 1) := 1
elsif dir = 0 and size = 2 then
map (x, y) := 1
map (x + 1, y) := 1
end if
if dir = 1 and size = 3 then
map (x, y) := 1
map (x, y + 1) := 1
map (x, y + 2) := 1
elsif dir = 0 and size = 3 then
map (x, y) := 1
map (x + 1, y) := 1
map (x + 2, y) := 1
end if
if dir = 1 and size = 4 then
map (x, y) := 1
map (x, y + 1) := 1
map (x, y + 2) := 1
map (x, y + 3) := 1
elsif dir = 0 and size = 4 then
map (x, y) := 1
map (x + 1, y) := 1
map (x + 2, y) := 1
map (x + 3, y) := 1
end if
end ship
ship (x, y, sizeOfShip, direction)
for row : 1 .. lengthOfArray
for col : 1 .. lengthOfArray
put map (row, col)..
end for
put ""
end for
TheXploder
Posted: Thu Jan 29, 2004 6:37 pm Post subject: (No subject)
ohh, I updated it...:
code:
%Variables/Declearation of Variables
View.Set ("offscreenonly")
var lengthOfArray : int := 10
var map : array 1 .. lengthOfArray, 1 .. lengthOfArray of string
for row : 1 .. lengthOfArray
for col : 1 .. lengthOfArray
map (row, col) := "0"
end for
end for
% Computer AI attacking Variables..
var xattack, yattack : int
var AIrandXArea, AIrandYArea : int := 4
var AIShootDir : int
var computerHits : boolean
var saveCoordinate : string := ""
computerHits := false
var sizeOfShip : int := Rand.Int (1, 4)
var direction : int := Rand.Int (0, 1)
proc ship (x, y, size, dir : int)
if dir = 1 and size = 1 then
map (x, y) := "1"
elsif dir = 0 and size = 1 then
end if
if dir = 1 and size = 2 then
map (x, y) := "1"
map (x, y + 1) := "1"
elsif dir = 0 and size = 2 then
map (x, y) := "1"
map (x + 1, y) := "1"
end if
if dir = 1 and size = 3 then
map (x, y) := "1"
map (x, y + 1) := "1"
map (x, y + 2) := "1"
elsif dir = 0 and size = 3 then
map (x, y) := "1"
map (x + 1, y) := "1"
map (x + 2, y) := "1"
end if
if dir = 1 and size = 4 then
map (x, y) := "1"
map (x, y + 1) := "1"
map (x, y + 2) := "1"
map (x, y + 3) := "1"
elsif dir = 0 and size = 4 then
map (x, y) := "1"
map (x + 1, y) := "1"
map (x + 2, y) := "1"
map (x + 3, y) := "1"
end if
end ship
proc Shoot
if computerHits = true then
randint (AIShootDir, 1, 4)
else
randint (xattack, 1, AIrandYArea)
randint (yattack, 1, AIrandYArea)
end if
end Shoot
Shoot
ship (1, 1, sizeOfShip, direction)
loop
for row : 1 .. lengthOfArray
for col : 1 .. lengthOfArray
map (row, col) := "0"
end for
end for
ship (1, 1, sizeOfShip, direction)
put intstr (xattack) + "," + intstr (yattack)
put computerHits
map (xattack, yattack) := "x"
Shoot
if map (xattack, yattack) = "1" then
put "Computer Hits"
computerHits := true
saveCoordinate := intstr (xattack) + "," + intstr (yattack)
put "Saved Coordinate: ", saveCoordinate
put ""
else
put "Computer Misses"
put ""
put ""
computerHits := false
end if
computerHits := false
for row : 1 .. lengthOfArray
for col : 1 .. lengthOfArray
put map (row, col) ..
end for
put ""
end for
delay (1000)
View.Update
cls
end loop
white_dragon
Posted: Sat Feb 07, 2004 5:54 pm Post subject: (No subject)
i encountered some troubles and problems in the program. but it looks and sounds really good!
Cervantes
Posted: Sat Feb 07, 2004 6:19 pm Post subject: (No subject)
good work, I like it. fix a few bugs and it'll be super!
the annoying bug is the text display messing up you should make it so that it clears the field after you entered the coordinate. or clear it as soona s its your turn to choose again.
Andy
Posted: Sat Feb 07, 2004 6:24 pm Post subject: (No subject)
u should do the starwarz version, its harder cuz the blocks r hexagons
TheXploder
Posted: Sat Feb 07, 2004 6:26 pm Post subject: (No subject)
never heard of a starwarz version.. can you xplain