josgilmo page

Statistics for quiz "Advanced design patterns in Go "

Total preguntas: 3
Total de veces intentado completo: 3
Promedio aciertos: 0.66666666666667
Total de veces resuelto 100% correcto: 0
Tiempo promedio utilizado : 59:46
Tiempo quiz más rápido: 00:14
Pregunta más veces equivocada: ```go type Operator interface { Apply(int, int) int } type Operation struct { Operator Operator } func (o *Operation) Operate(leftValue, rightValue int) int { return o.Operator.Apply(leftValue, rightValue) } ```

Número de aciertos

Ranking top users

Username Points Take
josgilmo 0 00:00
Question Good Fails


    type IObject interface {
        ObjDo(action string)
    }

    type Object struct {
        action string
    }

    func (obj *Object) ObjDo(action string) {
        fmt.Printf("I can, %s", action)
    }

    type PatternObject struct {
        object *Object
    }

    func (p *PatternObject) ObjDo(action string) {
        if p.object == nil {
            p.object = new(Object)
        }
        if action == "Run" {
            p.object.ObjDo(action) 
        }
    }
2 1

type Operator interface {
    Apply(int, int) int
}

type Operation struct {
    Operator Operator
}

func (o *Operation) Operate(leftValue, rightValue int) int {
    return o.Operator.Apply(leftValue, rightValue)
}
1 2

type Operator interface {
    Apply(int, int) int
}

type Operation struct {
    Operator Operator
}

func (o *Operation) Operate(leftValue, rightValue int) int {
    return o.Operator.Apply(leftValue, rightValue)
}
1 2