Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class Machine extends React.Component {
  2. render(){
  3.  
  4. doSpin();
  5. function doSpin() {
  6. let num = Math.floor(Math.random() * 3) +1 ;
  7. return(num);
  8. }
  9.  
  10. function machine(num) {
  11. if (num === 1) {
  12. const x = 'x';
  13. return x;
  14. } else if (num === 2){
  15. const y = 'y';
  16. return y
  17. } else {
  18. const z = 'z';
  19. return z;
  20. }
  21. }
  22. return(
  23. <p>{machine()},{machine()},{machine()} </p>
  24. )
  25.  
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement