Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IENumerable<T> func<T> (...)
- foreach (var s in list)
- yield return x (T);
- ^
- IENUMERABLE LA CLASE PRINCIPAL Y LA MYENUMERATOR ENUMERATIR<T>
- DOS GETENUMERATOR OBJECT Y T EN LA PRINCIPAL
- inumerable -> foreach sin el no hay
- tiene un metodo -> getEnumerator that returns MyEnumerator
- MY enumerator clase que implementa ienumerator
- you dont modify the original class my enumeator es la q haz todo
- tiene myenumerator un counter
- movenext (adds to the counter)
- current - > element que usas (posision actual)
- reset - > -1 porque el foreach llama a movenext y entos se mueve a 0 (pone al counter a -1)
- 2 current
- copy and paste the currents de fibonacci
- getEnumerator {MyEnumerator(this)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement