Click here to Skip to main content
11,567,926 members (44,072 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: What is your game console progression? Pin
Alexander DiMauro29-Jan-13 8:30
memberAlexander DiMauro29-Jan-13 8:30 
GeneralRe: What is your game console progression? Pin
PIEBALDconsult29-Jan-13 15:18
memberPIEBALDconsult29-Jan-13 15:18 
GeneralRe: What is your game console progression? Pin
Mark_Wallace29-Jan-13 21:27
memberMark_Wallace29-Jan-13 21:27 
GeneralRe: What is your game console progression? Pin
RogelioP / EX DE,HL30-Jan-13 1:29
memberRogelioP / EX DE,HL30-Jan-13 1:29 
GeneralGoogle Maps Epic Fail Pin
Shameel29-Jan-13 4:14
memberShameel29-Jan-13 4:14 
GeneralRe: Google Maps Epic Fail Pin
Bergholt Stuttley Johnson29-Jan-13 4:17
memberBergholt Stuttley Johnson29-Jan-13 4:17 
GeneralRe: Google Maps Epic Fail Pin
Mark_Wallace29-Jan-13 21:30
memberMark_Wallace29-Jan-13 21:30 
GeneralOn Cheating and Hard-Coding Pin
Ennis Ray Lynch, Jr.29-Jan-13 3:30
memberEnnis Ray Lynch, Jr.29-Jan-13 3:30 
So I play Ruzzle (like Boggle), its kind of fun. As a joke for one of my friends I developed an application to give me the list of longest playable words on the board, down and dirty. Originally, I wanted to do it right, and generic, but alas, I didn't want to spend a lot of time on a joke so I hard-coded the graph. At first it felt dirty and wrong, but then it felt, right?

Here was my approach (warning, code, avert your eyes ye lounge is for no code onliers. Oh, and DD, this isn't a trubechet) This is not presented for critique or questions, merely to illustrate how the hard-code actually worked well enough.

First create an object to hold a letter
public class Node{
    public string letter;
    public List<Node> nodes;
}
Now take a pen and paper, and number the grid starting left to right, top to bottom, zero through 16 (like an array). Then make a list of 16 elements:
foreach(string letter in lettersInOrder){
    allNodes.Add(new Node(letter));
}

Now hard-code the graph:
    allNodes[0].Nodes.Add(allNodes[1]);
    allNodes[0].Nodes.Add(allNodes[4]);
    allNodes[0].Nodes.Add(allNodes[5]);
    ...


I was surprised at how simple it was, all these years avoiding hard-coding and I just hard-coded a 4x4 grid! Laugh. Also, to keep this post mildly apropos I will not post the traversal code : )
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting.

"And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

"All users always want Excel" --Ennis Lynch

GeneralRe: On Cheating and Hard-Coding Pin
Rage29-Jan-13 3:47
memberRage29-Jan-13 3:47 
GeneralRe: On Cheating and Hard-Coding Pin
PIEBALDconsult29-Jan-13 4:07
memberPIEBALDconsult29-Jan-13 4:07 
GeneralRe: On Cheating and Hard-Coding Pin
Naerling29-Jan-13 20:47
memberNaerling29-Jan-13 20:47 
GeneralRe: On Cheating and Hard-Coding Pin
englebart30-Jan-13 2:26
memberenglebart30-Jan-13 2:26 
JokeRe: On Cheating and Hard-Coding Pin
RafagaX31-Jan-13 4:34
memberRafagaX31-Jan-13 4:34 
GeneralToo Smart For My Own Good Pin
GenJerDan29-Jan-13 3:29
memberGenJerDan29-Jan-13 3:29 
GeneralRe: Too Smart For My Own Good Pin
Rage29-Jan-13 3:46
memberRage29-Jan-13 3:46 
GeneralRe: Too Smart For My Own Good Pin
ChrisElston29-Jan-13 3:53
memberChrisElston29-Jan-13 3:53 
GeneralRe: Too Smart For My Own Good Pin
GenJerDan29-Jan-13 15:26
memberGenJerDan29-Jan-13 15:26 
GeneralRe: Too Smart For My Own Good Pin
GenJerDan29-Jan-13 3:55
memberGenJerDan29-Jan-13 3:55 
GeneralRe: Too Smart For My Own Good Pin
Stewart Judson29-Jan-13 4:19
memberStewart Judson29-Jan-13 4:19 
GeneralRe: Too Smart For My Own Good Pin
PIEBALDconsult29-Jan-13 3:54
memberPIEBALDconsult29-Jan-13 3:54 
GeneralRe: Too Smart For My Own Good Pin
deflinek29-Jan-13 4:12
memberdeflinek29-Jan-13 4:12 
GeneralRe: Too Smart For My Own Good Pin
Chris Quinn29-Jan-13 4:18
memberChris Quinn29-Jan-13 4:18 
GeneralRe: Too Smart For My Own Good Pin
OriginalGriff29-Jan-13 5:14
mvpOriginalGriff29-Jan-13 5:14 
GeneralRe: Too Smart For My Own Good Pin
Chris Quinn29-Jan-13 5:18
memberChris Quinn29-Jan-13 5:18 
GeneralRe: Too Smart For My Own Good Pin
OriginalGriff29-Jan-13 5:25
mvpOriginalGriff29-Jan-13 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 30 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid