Skip to content

Instantly share code, notes, and snippets.

@Mooophy
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save Mooophy/fd2855ecbd1dd711648a to your computer and use it in GitHub Desktop.

Select an option

Save Mooophy/fd2855ecbd1dd711648a to your computer and use it in GitHub Desktop.
1.upto(100){ |n| puts n%3 == 0 ? "face" : n }
@Mooophy

Mooophy commented Jun 13, 2015

Copy link
Copy Markdown
Author

to run:

ruby test.rb

output:

1
2
face
4
5
face
7
8
face
10
11
face
13
14
face
16
17
face
19
20
face
22
23
face
25
26
face
28
29
face
31
32
face
34
35
face
37
38
face
40
41
face
43
44
face
46
47
face
49
50
face
52
53
face
55
56
face
58
59
face
61
62
face
64
65
face
67
68
face
70
71
face
73
74
face
76
77
face
79
80
face
82
83
face
85
86
face
88
89
face
91
92
face
94
95
face
97
98
face
100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment