Net connection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Net connection

Rubén Parra Savall

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

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Net connection

Lukas Renggli
> 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.

http://www.catb.org/~esr/faqs/smart-questions.html

> I have the main renderContentOn that calls renderCell
>
> renderContentOn:html
> html table: [
>                 1 to: 10 do: [ :row |

It looks like you are missing a form tag.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside