[Seaside] Net connection

Rubén Parra Savall kenterish at hotmail.com
Wed Jun 6 12:22:25 UTC 2007


I'm involved in a project doing the battleship game, how would it be the way 
to play against another person connected in another computer, I mean, to 
play it by the net??

I'm very dissapointed that nobody answered my question, I think it wasn't 
very difficult for much of you. I transcript for last time.

I have the main renderContentOn that calls renderCell

renderContentOn:html
html table: [
		1 to: 10 do: [ :row |
		        html tableRow: [
			       1 to: 10 do: [ :col |
				   html tableData: [ self renderCell: row @ col on: html ] ] ] ] ] .


Each cell has a value, at first is zero, but if you submit the button, it
changes, and with this, here we have the point, it should change of colour
or stay with another if the value isn't changed. Now just show the value


renderCell: aPoint on: html
	| value |
	value := self model boardAt2: aPoint. "Method to extract the value of the
point in the array"


	html  submitButtonWithAction: [
		value isZero ifTrue: [ bool := (self model checkValue: aPoint).
					     (bool == true) ifTrue: [ self model boardAt2: aPoint put: 1.

self answer: self model. ]
								 ifFalse: [ self inform: ' Error'. ] .
						]
						ifFalse: [ self inform: ' Error '. ] .
		]
		text: (value isZero
			ifTrue: [ '   ' ]
			ifFalse: [ value ] ) .

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor 
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349



More information about the Seaside mailing list