fork download
  1. class Match
  2.  
  3. def foundMatch x
  4. @arr = Array[5, 3, 2, 7, 6]
  5. for num in @arr
  6. if(num == x)
  7. return true
  8. end
  9. end
  10. return false
  11. end
  12. end
  13.  
  14. m = Match.new
  15. puts(m.foundMatch(3) ? "Found match" : "Not found match")
Success #stdin #stdout 0.02s 7412KB
stdin
Standard input is empty
stdout
Found match