Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def newNumeralSystem(number)
- conversion = number.ord - 'A'.ord
- x = 0
- y = 0
- z = 0
- array = Array.new
- characters = Array.new
- characters = ('A'..'Z').to_a
- while (x <= conversion)
- while (y <= conversion)
- if x + y == conversion then
- array[z] = characters[x] + " + " + characters[y]
- z = z + 1
- end
- y = y + 1
- end
- x = x + 1
- y = x
- end
- return array
- end
Advertisement
Add Comment
Please, Sign In to add comment