Battleship Booleans

  • linepro 2012-11-12 08:02
    A34 frist

    Missed
  • steenbergh 2012-11-12 08:07
    Anybody else noticed that about halfway, there's a Tx in one cell, and an empty field ",," slightly further down the line?
  • mott555 2012-11-12 08:12
    TRWTF is the page source. Look at the markup for that grid of T's and x's.
  • Remy Porter 2012-11-12 08:15
    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.
  • Mike D. 2012-11-12 08:17
    Well, if you don't like a table like that, don't look at the XBM or XPM formats.
  • lmollea 2012-11-12 08:18
    Noticed, think that it could be a hint of a "file-not-foundian logic"...
  • wtf? 2012-11-12 08:18
    {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,…},
  • Trevel 2012-11-12 08:25
    {x,x,x,T,T,T,filenotfound,x,x,T}
  • Peter 2012-11-12 08:28
    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.
  • JimLahey 2012-11-12 08:31
    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,…},

    }
  • Rodnas 2012-11-12 08:37
    if you squint your eyes it looks like the BOFH with an evil grin oon his face.
  • Röb 2012-11-12 08:50
    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.
  • Kryptus 2012-11-12 08:51
    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.
  • bkDJ 2012-11-12 09:10
    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.
  • dpm 2012-11-12 09:13
    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?
  • Remy Porter 2012-11-12 09:16
    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.
  • XXXXXX 2012-11-12 09:17
    True or false?
    The developer wrote this way so he could hide an obscene diagram in the boolean grid.
  • ObiWayneKenobi 2012-11-12 09:17
    And then he got fired for changing things up, right?
  • foo 2012-11-12 09:19
    Why has noone done "FRIST" in x/T pixels yet? Are you all too lazy (like me), or was it deleted already?
  • Unicorn #2816 2012-11-12 09:27
    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.
  • Meep 2012-11-12 09:34
    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;
    }
    }
    }
  • configurator 2012-11-12 09:43
    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'))
  • Joe 2012-11-12 09:54
    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?
  • Frank 2012-11-12 09:59
    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.
  • Sebastian Buchanan 2012-11-12 10:10
    i remember using a similar method of true&false table to encode messages during the war
  • 2012-11-12 10:18
    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.
  • Cbuttius 2012-11-12 10:18
    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.

  • Plasmab 2012-11-12 10:24
    That looks like it was synthesised from a HDL like Verilog or VHDL. Really shouldnt be in a software application. :)
  • Dacer 2012-11-12 10:36
    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},

    }
  • Zapp Brannigan 2012-11-12 10:58
    I ran the array through a parser and it decodes to "Drink more Ovaltine!" He should have stored this array in a database.
  • chubertdev 2012-11-12 11:29
    Welcome, Barry, to The Matrix...
  • PedanticCurmudgeon 2012-11-12 11:45
    chubertdev:
    Welcome, Barry, to The Matrix...
    I don't even see the code any more. I just see blonde, brunette, redhead...
  • cellocgw 2012-11-12 12:02
    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..."
  • Meep 2012-11-12 12:08
    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.
  • chubertdev 2012-11-12 12:15
    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.
  • Nagesh 2012-11-12 12:19
    What is game of battleship?
  • bkDJ 2012-11-12 12:27
    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
  • Anonymous Paranoiac 2012-11-12 12:50
    Brilliant! He invented binary flags!
  • WhiskeyJack 2012-11-12 13:08
    Hey! You sunk my TTTTTTTTT
  • the beholder 2012-11-12 13:10
    PedanticCurmudgeon:
    chubertdev:
    Welcome, Barry, to The Matrix...
    I don't even see the code any more. I just see frigate, cruiser, aircraft carrier...
    FTFY
  • ch 2012-11-12 13:58
    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...
  • eVil 2012-11-12 16:18
    WhiskeyJack:
    Hey! You sunk my TTTTTTTTT


    this->GetCommentText();
  • db2 2012-11-12 16:42
    Reminds me of the old game-select matrices in Atari game manuals.
  • Pita 2012-11-12 16:45
    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?
  • El Ka-Ben 2012-11-12 16:50
    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.
  • Adanine 2012-11-12 18:05
    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
  • Silverhill 2012-11-12 18:36
    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?)
  • foo 2012-11-13 01:19
    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.
  • Coyne 2012-11-13 01:24
    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;

  • Iain 2012-11-13 04:41
    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.
  • Hatshepsut 2012-11-13 05:20
    Nagesh:
    What is game of battleship?


    It's like Battlesheep, but with ships.

  • Cbuttius 2012-11-13 05:54
    Firstly the obvious WTF comment that a boolean needs to be a byte rather than a bit so it can hold a FILE_NOT_FOUND value as well as a true or false...

    Now to the real issue of which one gives you better "performance".

    If you plan to store millions of these in memory then using a bitset will occupy less memory.

    It is marginally quicker in processing time to test a byte for true/false rather than testing a bit in a bitset, which requires first working out which bit of which byte before actually doing the bitwise operation. In reality though it is constant time and very fast either way.

    Most of the time, choosing between them is likely to be a premature optimisation. I have never yet seen an application significantly sped up because they used an array of bytes rather than a bitset. I have seen large scale applications that store large amounts of data where a bitset was therefore more appropriate although if the plan is to iterate through it finding which bytes are set, and they are sparse, this is a linear search which is of course slow.

    Specialising std::vector<bool> to use bitset internally is a WTF and everybody in the C++ world now knows it is. It is a premature optimisation on space which breaks the generic behaviour of std::vector, e.g. you can't do &v[0] to get an array of bool, and various other operations that will give you bools by reference. They added std::bitset for those who want it (which is also a WTF as it is not resizeable). boost provided dynamic_bitset which really is the best option to use for a bitset.

    Storing a bitset as a static table would not really improve any efficiency and it would of course be harded to maintain. I would probably use 0 and 1 rather than T and x but it doesn't make a huge difference.

    Of course if you were unable to locate this static table on your system, the result of a query on one of its values would genuinely be "file not found".
  • brazzy 2012-11-13 08:02
    Plasmab:
    That looks like it was synthesised from a HDL like Verilog or VHDL. Really shouldnt be in a software application. :)


    My guess is that it was synthesized from an Excel table embedded in a Word document with "specification" or "requirements" in the title.
  • Spewin Coffee 2012-11-13 12:37
    The movie Battleship was terrible. The script writers didn't even make the requisite "G4? It's a hit!" joke from the box cover.

  • Silverhill 2012-11-13 18:41
    Isn't that "Bob" Dobbs on that cover?
  • EuroGuy 2012-11-14 06:47
    I like how the men on the box cover are playing the game, whilst the women have to occupy themselves with the dishes!
  • Cbuttius 2012-11-15 05:13
    The actual WTF here is that he deleted the file containing the table, and missed a part of the code that still relied on it.

    When that part of the code ran and tried to acquire the boolean result for the number, it got FILE NOT FOUND.
  • LonesomeProgrammer 2012-11-16 04:38
    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.


    Don't know if trolling or assembly programmer, but I'll bite. I have one word for you: abstraction. And it is your friend, your god, and your savior at the same time. Therefore you say thank you and make good use of it. The guy who wrote this code didn't.
  • Joe Z 2013-01-01 10:48
    That table and the state variables reminds me an awful lot of the control PLA on the 6502. It's a big table very similar to that, and works under a similar principle.