Post History
J, 17 char +/`5:@.(2*./@:=]) How it works: What's within parentheses tests if both numbers on the right are 2. If so, the verb agenda @. selects the verb 5: which is always 5. If not, the ve...
Answer
#2: Post edited
- # J, 17 char
- ```
- +/`5:@.(2*./@:=])
- ```
- ```
- +/`5:@.(2*./@:=]) 2 2
- 5
- +/`5:@.(2*./@:=]) 2 3
- 5
- +/`5:@.(2*./@:=]) 1 3
- 4
- +/`5:@.(2*./@:=]) 0 4
- 4
- +/`5:@.(2*./@:=]) 3 7
- 10
- ```
- # J, 17 char
- ```
- +/`5:@.(2*./@:=])
- ```
- **How it works:**
- What's within parentheses tests if both numbers on the right are 2.
- If so, the verb agenda @. selects the verb 5: which is always 5.
- If not, the verb agenda @. selects the verb +/ which sums the numbers.
- ```
- +/`5:@.(2*./@:=]) 2 2
- 5
- +/`5:@.(2*./@:=]) 2 3
- 5
- +/`5:@.(2*./@:=]) 1 3
- 4
- +/`5:@.(2*./@:=]) 0 4
- 4
- +/`5:@.(2*./@:=]) 3 7
- 10
- ```