Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Strategy design pattern implementation

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.73 sec, absolute running time: 0.28 sec, cpu time: 0.2 sec, memory peak: 3 Mb, absolute service time: 1,02 sec 
edit mode |  history
Error(s):
 [TRACE] LinearCombStrategy => I was cloned
 [TRACE] LinearCombStrategy => I was cloned
==== Strategy = add ====
 strategy = add ( x = 3 ; y = 4 )
Result = 7
==== Strategy = mul ====
 strategy = mul ( x = 3 ; y = 4 )
Result = 7
==== Strategy = Linear combination ====
 strategy = Linear combination a * x + b * y + c ( x = 3 ; y = 4 )
Result = 31
==== Strategy = Linear combination [2] ====
 strategy = Linear combination a * x + b * y + c ( x = 5 ; y = 3 )
Result = 55
==== Strategy = Linear combination [2] ====
 strategy = Linear combination a * x + b * y + c ( x = 2 ; y = 6 )
Result = 52

    
                
λ
.NET NoSQL database for rapid development