Comment On Battleship Booleans

Barry’s first problem with the code was the use of magic numbers. If the application state variable held “127”, it then certain buttons would be enabled, but if it were “54”, then they should be disabled. [expand full text]
« PrevPage 1 | Page 2Next »

Re: Battleship Booleans

2012-11-12 08:02 • by linepro (unregistered)
A34 frist

Missed

Re: Battleship Booleans

2012-11-12 08:07 • by steenbergh
Anybody else noticed that about halfway, there's a Tx in one cell, and an empty field ",," slightly further down the line?

Re: Battleship Booleans

2012-11-12 08:12 • by mott555
TRWTF is the page source. Look at the markup for that grid of T's and x's.

Re: Battleship Booleans

2012-11-12 08:15 • by Remy Porter
394661 in reply to 394660
Tool generated markup. We tried some JavaScript-based solutions, but they don't play nice with many RSS tools, and a lot of our readers use RSS.

Re: Battleship Booleans

2012-11-12 08:17 • by Mike D. (unregistered)
Well, if you don't like a table like that, don't look at the XBM or XPM formats.

Re: Battleship Booleans

2012-11-12 08:18 • by lmollea (unregistered)
394663 in reply to 394658
Noticed, think that it could be a hint of a "file-not-foundian logic"...

Re: Battleship Booleans

2012-11-12 08:18 • by wtf? (unregistered)
{x,x,x,x,x,x,x,x,x,xT,T,T,T,T,T,T,T,T,T,,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},

Re: Battleship Booleans

2012-11-12 08:25 • by Trevel (unregistered)
{x,x,x,T,T,T,filenotfound,x,x,T}

Re: Battleship Booleans

2012-11-12 08:28 • by Peter (unregistered)
394666 in reply to 394660
Actually, TRWTF is that we check the page source for Remy's comments.

mott555:
TRWTF is the page source. Look at the markup for that grid of T's and x's.

Re: Battleship Booleans

2012-11-12 08:31 • by JimLahey
Refactored it a bit, given that T and x are boolean constants for true and false:

bool[,] set = {
{T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,T,T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,T,!T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,T,T,T,T,T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,T,T,T,T,!T,…},
{!T,!T,!T,!T,T,T,T,T,T,T,T,T,T,T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,T,!T,!T,!T,!T,!T,!T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,!TT,T,T,T,T,T,T,T,T,T,,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,!T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},
{!T,T,!T,T,!T,T,!T,T,!T,T,!T,T,!T,T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,!T,…},

}

Re: Battleship Booleans

2012-11-12 08:37 • by Rodnas (unregistered)
if you squint your eyes it looks like the BOFH with an evil grin oon his face.

Re: Battleship Booleans

2012-11-12 08:50 • by Röb (unregistered)
394669 in reply to 394660
Can't tell if trolling... you write that as if you think someone actually wrote the markup and didn't use a code highlighter script.

Re: Battleship Booleans

2012-11-12 08:51 • by Kryptus (unregistered)
bool[,] set = {
{T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,x,…},
{x,x,x,x,x,x,x,x,x,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,T,T,x,…},
{x,x,x,x,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,T,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,…},
{x,x,x,x,x,x,x,x,x,x,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,T,T,T,T,FILE_NOT_FOUND,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,T,x,T,x,T,x,T,x,T,x,T,x,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},

}

Fixed.

Re: Battleship Booleans

2012-11-12 09:10 • by bkDJ (unregistered)
394671 in reply to 394666
Peter:
Actually, TRWTF is that we check the page source for Remy's comments.

I read this site on my iPad so I made a shitty JS bookmark let I can run and it shows comments and cornify links. I was surprised that it actually showed an extra (dupe) picture in Friday's Error'd. I can share it so you don't have to hunt through the source, if you want.

Re: Battleship Booleans

2012-11-12 09:13 • by dpm (unregistered)
394672 in reply to 394661
Remy Porter:
Tool generated markup. We tried some JavaScript-based solutions, but they don't play nice with many RSS tools, and a lot of our readers use RSS.
So the PRE tag isn't good enough any more?

Re: Battleship Booleans

2012-11-12 09:16 • by Remy Porter
394673 in reply to 394672
In the era of IDEs, long code blocks feel unreadable without some highlighting. I admit, this one doesn't really need highlighting, but many of them do.

Re: Battleship Booleans

2012-11-12 09:17 • by XXXXXX (unregistered)
True or false?
The developer wrote this way so he could hide an obscene diagram in the boolean grid.

Re: Battleship Booleans

2012-11-12 09:17 • by ObiWayneKenobi
And then he got fired for changing things up, right?

Re: Battleship Booleans

2012-11-12 09:19 • by foo (unregistered)
Why has noone done "FRIST" in x/T pixels yet? Are you all too lazy (like me), or was it deleted already?

Re: Battleship Booleans

2012-11-12 09:27 • by Unicorn #2816 (unregistered)
394677 in reply to 394658
steenbergh:
Anybody else noticed that about halfway, there's a Tx in one cell, and an empty field ",," slightly further down the line?

I have a feeling no one else noticed that.

Re: Battleship Booleans

2012-11-12 09:34 • by Meep (unregistered)
TRWTF is that the could have used a switch statement.


for(int i = 0; i < 32; i++) {
for(int j = 0; j < 32; j++) {
switch(i << 5 + j) {
case 0:
if(a == i && b == j)
v = T;
break;
case 1:
if(a == i && b == j)
v = x;
break;
...
default:
v = FILE_NOT_FOUND;
break;
}
}
}

Re: Battleship Booleans

2012-11-12 09:43 • by configurator
394679 in reply to 394671
bkDJ:
Peter:
Actually, TRWTF is that we check the page source for Remy's comments.

I read this site on my iPad so I made a shitty JS bookmark let I can run and it shows comments and cornify links. I was surprised that it actually showed an extra (dupe) picture in Friday's Error'd. I can share it so you don't have to hunt through the source, if you want.


I use a userscript. Drag this (in a .js file) into your Chrome extensions page (or install it on your other browser however you do that there).

Note: code is based on a previous comment on TDWTF.


// ==UserScript==
// @name Show comments on The Daily WTF articles
// @match http://thedailywtf.com/Articles/*.aspx
// ==/UserScript==

(function(b) {
b.innerHTML = b.innerHTML
.replace(/<!--/g,'<span style="color:red;">')
.replace(/-->/g,'</span>');
})(document.querySelector('.ArticleBody'))

Re: Battleship Booleans

2012-11-12 09:54 • by Joe (unregistered)
394680 in reply to 394672
dpm:
Remy Porter:
Tool generated markup. We tried some JavaScript-based solutions, but they don't play nice with many RSS tools, and a lot of our readers use RSS.
So the PRE tag isn't good enough any more?
Yeah, if you want a web page to say "x,x,x,x,x,x,x,x,x,T,T,T,T,T,x,x,x,x" what's wrong with putting "x,x,x,x,x,x,x,x,x,T,T,T,T,T,x,x,x,x" as the content?

Not Enterprisey enough?

Re: Battleship Booleans

2012-11-12 09:59 • by Frank (unregistered)
Look, if you really understand computers you'd know that deep inside this is all there is. Massive acreage of Trues and Falses. OK maybe this guy represented them funny, with T and x instead of 1 and 0, but those are just symbols, not the actual bits, so it really doesn't matter what symbol you use as long as you are consistent.

If you can't grok a mass of bits you really should be in some other line of work.

Re: Battleship Booleans

2012-11-12 10:10 • by Sebastian Buchanan (unregistered)
i remember using a similar method of true&false table to encode messages during the war

Re: Battleship Booleans

2012-11-12 10:18 • by … (unregistered)
Honestly, this may be the better alternative. If the matching of magic numbers is mostly arbitrary, this approach can be more “readable” than a long condition whose meaning is not obvious.

Rule of thumb: if you have to draw the table to derive the boolean equation, you're probably better off just using the table.

Re: Battleship Booleans

2012-11-12 10:18 • by Cbuttius
Someone once had the brainwave when implementing the standard library, that a vector of bool should not actually be a vector of bools at all but should be implemented internally as a bitset to save a few bytes.

It breaks all sort of generic C++ code though to do that.

The implementation here to store a static table isn't great but at least they didn't try to use a bitset.

Re: Battleship Booleans

2012-11-12 10:24 • by Plasmab (unregistered)
That looks like it was synthesised from a HDL like Verilog or VHDL. Really shouldnt be in a software application. :)

Re: Battleship Booleans

2012-11-12 10:36 • by Dacer (unregistered)
bool[,] set = {
{T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,x,…},
{x,x,x,x,x,x,x,x,x,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,T,T,x,…},
{x,x,x,x,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,T,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,…},
{x,x,x,x,x,x,x,x,x,x,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,x,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,x,x,x,x,x,x,x,…},
{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,…},
{x,T,x,T,x,T,x,T,x,T,x,T,x,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,Thats it},

}

Re: Battleship Booleans

2012-11-12 10:58 • by Zapp Brannigan (unregistered)
I ran the array through a parser and it decodes to "Drink more Ovaltine!" He should have stored this array in a database.

Re: Battleship Booleans

2012-11-12 11:29 • by chubertdev
Welcome, Barry, to The Matrix...

Re: Battleship Booleans

2012-11-12 11:45 • by PedanticCurmudgeon
394689 in reply to 394688
chubertdev:
Welcome, Barry, to The Matrix...
I don't even see the code any more. I just see blonde, brunette, redhead...

Re: Battleship Booleans

2012-11-12 12:02 • by cellocgw
394691 in reply to 394689
PedanticCurmudgeon:
chubertdev:
Welcome, Barry, to The Matrix...
I don't even see the code any more. I just see blonde, brunette, redhead...

For that, shouldn't each line be more like "xxxTTAxxxxxxTTAxxxx..."

Re: Battleship Booleans

2012-11-12 12:08 • by Meep (unregistered)
394692 in reply to 394681
Frank:
Look, if you really understand computers you'd know that deep inside this is all there is. Massive acreage of Trues and Falses. OK maybe this guy represented them funny, with T and x instead of 1 and 0, but those are just symbols, not the actual bits, so it really doesn't matter what symbol you use as long as you are consistent.

If you can't grok a mass of bits you really should be in some other line of work.


All there is? Uh, no. "Deep inside" there are wires, resistors and transistors. All of these things implement logical functions like AND or OR, none of them implement logical values. One could make the tendentious claim that f(x) = true is the same thing as 'true', but you didn't, and it's not. The "trues" and "falses" only exist as potential differences on the wires, capacitance in DRAM cells, or magnetic polarity in storage, that is, they are hardly there at all.

And if you grokked Boolean algebra, you'd realize that any first-order logic function can be expressed as a truth table (which is what the T's and x's are) and which itself is just a simple rendering of a sum of products expression. The submitter probably just reduced that to a straightforward expression using a Karnaugh map, or possibly common sense.

Re: Battleship Booleans

2012-11-12 12:15 • by chubertdev
394693 in reply to 394681
Frank:
Look, if you really understand computers you'd know that deep inside this is all there is. Massive acreage of Trues and Falses. OK maybe this guy represented them funny, with T and x instead of 1 and 0, but those are just symbols, not the actual bits, so it really doesn't matter what symbol you use as long as you are consistent.

If you can't grok a mass of bits you really should be in some other line of work.


The code is (theoretically) good in that it works, which is the main goal of any software. But the downfall is that it's not maintainable. It fails the test of documenting itself. If you write code that other people look at, and have no idea what the business rules are behind it, you're probably doing something wrong. And with a huge amount of "magic booleans", this code is definitely a WTF.

Re: Battleship Booleans

2012-11-12 12:19 • by Nagesh
What is game of battleship?

Re: Battleship Booleans

2012-11-12 12:27 • by bkDJ
configurator:
bkDJ:
Peter:
Actually, TRWTF is that we check the page source for Remy's comments.
I read this site on my iPad so I made a shitty JS bookmarklet I can run and it shows comments and cornify links. I was surprised that it actually showed an extra (dupe) picture in Friday's Error'd. I can share it so you don't have to hunt through the source, if you want.


I use a userscript. Drag this (in a .js file) into your Chrome extensions page (or install it on your other browser however you do that there).

Note: code is based on a previous comment on TDWTF.

(snip)
Yeah I used that old comment as a starting base but it kind of ballooned. It makes comments green on black, makes <p></p> actual linebreaks within comments and leaves other tags intact (hence why the <img/> tag worked in friday's article). It also surrounds cornify links with unicorn faces and summarizes what it did at the top of the article. the code is probably inefficient because it's my first foray into JS but it gets the job done. Also the images and text may be kind of small because I use it on a retina iPad. Here it is: http://pastebin.com/d4zJBXgr

Re: Battleship Booleans

2012-11-12 12:50 • by Anonymous Paranoiac (unregistered)
Brilliant! He invented binary flags!

Re: Battleship Booleans

2012-11-12 13:08 • by WhiskeyJack
Hey! You sunk my TTTTTTTTT

Re: Battleship Booleans

2012-11-12 13:10 • by the beholder (unregistered)
394700 in reply to 394689
PedanticCurmudgeon:
chubertdev:
Welcome, Barry, to The Matrix...
I don't even see the code any more. I just see frigate, cruiser, aircraft carrier...
FTFY

Re: Battleship Booleans

2012-11-12 13:58 • by ch (unregistered)
I know for a fact that Coco/R generates exactly such code, down to the name of the variable. If that is the source, I don't see any WTF, it's just some unreadable generated code.

However, if someone actually wrote this by hand, run...

Re: Battleship Booleans

2012-11-12 16:18 • by eVil (unregistered)
394705 in reply to 394699
WhiskeyJack:
Hey! You sunk my TTTTTTTTT


this->GetCommentText();

Re: Battleship Booleans

2012-11-12 16:42 • by db2
Reminds me of the old game-select matrices in Atari game manuals.

Re: Battleship Booleans

2012-11-12 16:45 • by Pita (unregistered)
Howard Wolowitz: C-7
Raj Koothrappali: Miss
Howard Wolowitz: How can that be a miss? C-6 was a it. C-8 was a hit. Part of your starship has to be on C-7.
Raj Koothrappali: Not if it has a hole in the middle.
Howard Wolowitz: What kind of space ship has a hole in the middle?
Raj Koothrappali: A... Romulan battle bagel?

Re: Battleship Booleans

2012-11-12 16:50 • by El Ka-Ben (unregistered)
394708 in reply to 394698
Anonymous Paranoiac:
Brilliant! He invented binary flags!


Yeah, the kind of thing that was really useful when we had teeny-tiny amounts of RAM, and probably useful in the early 8-bit PC days, depending on hardware, but very much less useful now.

Memory is cheap, so it matters little if a Boolean is a bit, a byte, or a full 64-bit word and I recall it being (not that I've really thought about it in years) more expensive to do all the bit-twiddling than to read an aligned word.

I really can't figure out a good reason for magic numbers offhand. Maybe if I sat and thought about it for a while I could, but generally reading and setting preferences is a small part of your computational time, and file size isn't really a concern, we've moved to XML for so much and it's very wordy.

Security doesn't make any sense either.

Re: Battleship Booleans

2012-11-12 18:05 • by Adanine
394710 in reply to 394681
Frank:
Look, if you really understand computers you'd know that deep inside this is all there is. Massive acreage of Trues and Falses. OK maybe this guy represented them funny, with T and x instead of 1 and 0, but those are just symbols, not the actual bits, so it really doesn't matter what symbol you use as long as you are consistent.

If you can't grok a mass of bits you really should be in some other line of work.
I'm sure that a Boolean is a byte, not a bit (Atleast in C++). Bitwise analysis may make sense, but in this context it doesn't.

Actually, scratch that. It doesn't make sense regardless. With more then four billion bytes of memory in most computers, we can afford to waste some just so the code we make is maintainable* (For both ourselves and others).

If you want to code with bits, do something in assembly or machine code.

* I'm almost certain there are legitimate exceptions to this (Ie, drivers), but not something 95% of coders would actually encounter

Re: Battleship Booleans

2012-11-12 18:36 • by Silverhill
394711 in reply to 394676
foo:
Why has noone done "FRIST" in x/T pixels yet? Are you all too lazy (like me), or was it deleted already?

bool[,] set = {
{T,T,T,T,T,T,x,x,T,T,T,T,T,x,x,x,T,T,T,T,x,x,T,T,T,x,x,x,T,T,T,T,T,T,…},
{T,T,T,T,T,T,x,x,T,T,T,T,T,T,x,x,T,T,T,T,x,T,T,x,T,T,x,x,T,T,T,T,T,T,…},
{T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,x,T,T,x,x,T,T,x,x,x,x,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,x,T,T,x,x,T,T,x,x,x,x,x,x,x,T,T,x,x,…},
{T,T,T,T,x,x,x,x,T,T,x,x,T,T,x,x,x,T,T,x,x,x,T,T,x,x,x,x,x,x,T,T,x,x,…},
{T,T,T,T,x,x,x,x,T,T,x,T,T,x,x,x,x,T,T,x,x,x,x,T,T,x,x,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,T,T,x,x,x,x,x,T,T,x,x,x,x,x,T,T,x,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,x,T,T,x,x,x,x,T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,x,x,T,T,x,x,x,T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,T,T,T,T,x,T,T,x,T,T,x,x,x,x,T,T,x,x,…},
{T,T,x,x,x,x,x,x,T,T,x,x,x,T,T,x,T,T,T,T,x,x,T,T,T,T,x,x,x,x,T,T,x,x,…},

}




(a little difficult to discern, alas, but...anyone willing to care?)

Re: Battleship Booleans

2012-11-13 01:19 • by foo (unregistered)
394713 in reply to 394710
Adanine:
I'm sure that a Boolean is a byte, not a bit (Atleast in C++). Bitwise analysis may make sense, but in this context it doesn't.

Actually, scratch that. It doesn't make sense regardless. With more then four billion bytes of memory in most computers, we can afford to waste some just so the code we make is maintainable* (For both ourselves and others).

If you want to code with bits, do something in assembly or machine code.

* I'm almost certain there are legitimate exceptions to this (Ie, drivers), but not something 95% of coders would actually encounter
Sure, drivers and other code dealing with hardware.

Reading/writing binary file formats or protocols, of course.

And big data. For single Boolean variables, or even small and medium-sizes arrays, storing them in bytes or words makes things easier and often faster. But for large arrays (containing significant numbers of Booleans) compact storage can still matter. It's not only main memory size, there's also cache misses, storage capacity, network speed etc. So, depending on your needs, you may have barriers at various orders of magnitude with direct influence on speed, cost or even feasibility.

For such cases, the infamous vector<bool> may actually be useful, but since they're rare, it should have been a separate type rather than a specialization of a common template, indeed.

Re: Battleship Booleans

2012-11-13 01:24 • by Coyne
He should have represented his table with 1's, and 0's, with scattered l's and O's for fun.

Throw in a little mean-state logic, and we move up to nightmare**2. For example for evaluating each character we might use this:

  truth = (ch & 0x1) != 0;

Re: Battleship Booleans

2012-11-13 04:41 • by Iain (unregistered)
394716 in reply to 394695
Nagesh:
What is game of battleship?


You can manage faux poor English for a post, but in the age of Google claiming ignorance of something that can be discovered in a simple search, such as http://en.wikipedia.org/wiki/Battleships_(game), just proves it's an act.
« PrevPage 1 | Page 2Next »

Add Comment