Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. add4[x_] := x + 4
  2.  
  3. Do[a = add4[t];
  4. If[a == 6 && add4[t + 1] == 7, Break[]], {t, 5}]
  5.  
  6. a
  7.  
  8. Clear[add4]
  9. count = 0;
  10.  
  11. add4[x_] := add4[x] = (count++; x + 4)
  12. Do[a = add4[t];
  13. If[a <= 6 && add4[t + 1] == 7, Break[]], {t, 5}]
  14.  
  15. {a, count}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement