Click here to Skip to main content
15,898,134 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Find an algorithm Pin
Member 419050110-Oct-10 21:01
Member 419050110-Oct-10 21:01 
GeneralRe: Find an algorithm Pin
Not Active11-Oct-10 2:03
mentorNot Active11-Oct-10 2:03 
GeneralRe: Find an algorithm Pin
Luc Pattyn11-Oct-10 3:06
sitebuilderLuc Pattyn11-Oct-10 3:06 
GeneralRe: Find an algorithm Pin
parth.p11-Oct-10 5:27
parth.p11-Oct-10 5:27 
GeneralRe: Find an algorithm Pin
Luc Pattyn11-Oct-10 5:46
sitebuilderLuc Pattyn11-Oct-10 5:46 
AnswerRe: Find an algorithm [modified] Pin
R. Erasmus10-Oct-10 23:01
R. Erasmus10-Oct-10 23:01 
GeneralRe: Find an algorithm Pin
Luc Pattyn11-Oct-10 1:30
sitebuilderLuc Pattyn11-Oct-10 1:30 
AnswerRe: Find an algorithm Pin
grgran11-Oct-10 4:59
grgran11-Oct-10 4:59 
If it were me I'd ask a lot more questions of whoever gave you this. The first two inputs to Logic appear to have no effect on the result and (if that's true) should be removed. This leaves a four bit table mapping:

false, false, false, false, false
false, false, true, true, true
false, false, true, false, false
true, false, true, true, false
true, true, true, true, true

Which can also be looked at as a bit table
d dl r rl Exp Dec
0 0 0 0 0 00 *
0 0 0 1 ? 01
0 0 1 0 0 02 *
0 0 1 1 1 03 *
0 1 0 0 ? 04
0 1 0 1 ? 05
0 1 1 0 ? 06
0 1 1 1 ? 07
1 0 0 0 ? 08
1 0 0 1 ? 09
1 0 1 0 ? 10
1 0 1 1 0 11 *
1 1 0 0 ? 12
1 1 0 1 ? 13
1 1 1 0 ? 14
1 1 1 1 1 15 *

There doesn't appear to be an obvious pattern, but there are lots of unknowns. I'd be tempted to change Logic to remove the first two parameters and return a bool? (nullable<bool>). I'd then convert d, dl, r and rl into a single byte value and use a switch statement to return the known results, returning null for undefined results. If a pattern later emerges you can do something 'pretty' then.
GeneralRe: Find an algorithm Pin
Luc Pattyn11-Oct-10 5:04
sitebuilderLuc Pattyn11-Oct-10 5:04 
GeneralRe: Find an algorithm Pin
grgran11-Oct-10 5:32
grgran11-Oct-10 5:32 
GeneralRe: Find an algorithm Pin
Not Active11-Oct-10 7:20
mentorNot Active11-Oct-10 7:20 
GeneralRe: Find an algorithm Pin
grgran11-Oct-10 10:54
grgran11-Oct-10 10:54 
AnswerRe: Find an algorithm Pin
frank3311-Oct-10 6:56
frank3311-Oct-10 6:56 
GeneralRe: Find an algorithm Pin
Not Active11-Oct-10 7:21
mentorNot Active11-Oct-10 7:21 
AnswerRe: Find an algorithm Pin
ashishpahlaz13-Oct-10 0:50
ashishpahlaz13-Oct-10 0:50 
GeneralRe: Find an algorithm Pin
Luc Pattyn13-Oct-10 2:37
sitebuilderLuc Pattyn13-Oct-10 2:37 
GeneralRe: Find an algorithm Pin
ashishpahlaz15-Oct-10 4:20
ashishpahlaz15-Oct-10 4:20 
AnswerRe: Find an algorithm Pin
Tadeusz Westawic28-Oct-10 3:45
Tadeusz Westawic28-Oct-10 3:45 
GeneralRe: Find an algorithm Pin
Not Active28-Oct-10 7:35
mentorNot Active28-Oct-10 7:35 
GeneralRe: Find an algorithm Pin
Tadeusz Westawic28-Oct-10 9:29
Tadeusz Westawic28-Oct-10 9:29 
GeneralRe: Find an algorithm Pin
Not Active28-Oct-10 13:34
mentorNot Active28-Oct-10 13:34 
AnswerRe: Find an algorithm Pin
fjdiewornncalwe28-Oct-10 4:14
professionalfjdiewornncalwe28-Oct-10 4:14 
GeneralRe: Find an algorithm Pin
Not Active28-Oct-10 7:36
mentorNot Active28-Oct-10 7:36 
GeneralRe: Find an algorithm Pin
fjdiewornncalwe28-Oct-10 10:33
professionalfjdiewornncalwe28-Oct-10 10:33 
AnswerRe: Find an algorithm Pin
Radhakrishnan G.3-Nov-10 5:03
Radhakrishnan G.3-Nov-10 5:03 

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.