Click here to Skip to main content
15,888,351 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Nuts and bolts - Programming contest Pin
OriginalGriff28-Dec-20 9:30
mveOriginalGriff28-Dec-20 9:30 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult28-Dec-20 9:40
mvePIEBALDconsult28-Dec-20 9:40 
GeneralRe: Nuts and bolts - Programming contest Pin
OriginalGriff28-Dec-20 9:44
mveOriginalGriff28-Dec-20 9:44 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult28-Dec-20 9:36
mvePIEBALDconsult28-Dec-20 9:36 
GeneralRe: Nuts and bolts - Programming contest Pin
theoldfool28-Dec-20 9:44
professionaltheoldfool28-Dec-20 9:44 
GeneralRe: Nuts and bolts - Programming contest Pin
#realJSOP28-Dec-20 11:53
mve#realJSOP28-Dec-20 11:53 
GeneralRe: Nuts and bolts - Programming contest Pin
DRHuff28-Dec-20 13:40
DRHuff28-Dec-20 13:40 
GeneralRe: Nuts and bolts - Programming contest Pin
#realJSOP28-Dec-20 20:31
mve#realJSOP28-Dec-20 20:31 
The only way around that is to have manually pre-sorted lists, which I see as cheating.

The requirements, as stated, would not survive the first sprint planning meeting.

I'm the only person that has presented code, so I guess I win the contest.

And here's a version that doesn't sort (but it won't be included in the final product because I'm the project lead dev and the customer does not determine technique used in the code):

C#
foreach(Part nut in nuts)
{
    foreach (Part bolt in bolts)
    {
        if (nut.Diameter == bolt.Diameter && nut.Pitch == bolt.Pitch)
        {
            Console.WriteLine("Pair: [{0}] - [{1}]", nut, bolt);
        }
    }
}

".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013


modified 29-Dec-20 2:45am.

GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult29-Dec-20 3:54
mvePIEBALDconsult29-Dec-20 3:54 
GeneralRe: Nuts and bolts - Programming contest Pin
#realJSOP29-Dec-20 5:00
mve#realJSOP29-Dec-20 5:00 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult29-Dec-20 6:11
mvePIEBALDconsult29-Dec-20 6:11 
GeneralRe: Nuts and bolts - Programming contest Pin
#realJSOP30-Dec-20 3:20
mve#realJSOP30-Dec-20 3:20 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult30-Dec-20 3:52
mvePIEBALDconsult30-Dec-20 3:52 
GeneralRe: Nuts and bolts - Programming contest Pin
Jörgen Andersson30-Dec-20 9:33
professionalJörgen Andersson30-Dec-20 9:33 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult30-Dec-20 16:41
mvePIEBALDconsult30-Dec-20 16:41 
GeneralRe: Nuts and bolts - Programming contest Pin
Kornfeld Eliyahu Peter28-Dec-20 23:12
professionalKornfeld Eliyahu Peter28-Dec-20 23:12 
GeneralRe: Nuts and bolts - Programming contest Pin
Sander Rossel29-Dec-20 3:20
professionalSander Rossel29-Dec-20 3:20 
GeneralRe: Nuts and bolts - Programming contest Pin
Harrison Pratt29-Dec-20 4:20
professionalHarrison Pratt29-Dec-20 4:20 
GeneralRe: Nuts and bolts - Programming contest Pin
Harrison Pratt29-Dec-20 5:07
professionalHarrison Pratt29-Dec-20 5:07 
GeneralRe: Nuts and bolts - Programming contest Pin
Dan Sutton29-Dec-20 6:15
Dan Sutton29-Dec-20 6:15 
GeneralRe: Nuts and bolts - Programming contest Pin
Kirk 1038982129-Dec-20 10:41
Kirk 1038982129-Dec-20 10:41 
GeneralRe: Nuts and bolts - Programming contest Pin
James Lonero29-Dec-20 15:00
James Lonero29-Dec-20 15:00 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult30-Dec-20 12:59
mvePIEBALDconsult30-Dec-20 12:59 
GeneralRe: Nuts and bolts - Programming contest Pin
OldDBA31-Dec-20 3:56
OldDBA31-Dec-20 3:56 
GeneralRe: Nuts and bolts - Programming contest Pin
PIEBALDconsult31-Dec-20 12:22
mvePIEBALDconsult31-Dec-20 12:22 

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

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