User talk:Nigel Galloway
In re Execute Ramsey Mathprog; what were you trying to achieve with that? What language were you writing in? –Donal Fellows 13:16, 5 January 2012 (UTC)
Minor tweaks to Ruby Semordnilap
I found your approach to the solution refreshingly different from the others on the page. Very nice. I have a few notes on the Ruby specifics that you may find useful:
- Ruby has String#chomp built-in, so there's no need to reimplement it with a manual tr.
- Blocks of the form { |obj| obj.method } can be shortened to parameters of the form &:method.
- String#== has the same semantics as String#eql? and seems to be preferred by the community in idiomatic Ruby.
- Instead of initializing an array to empty and then pushing onto it conditionally inside a loop, you can construct the new array as a piece by using select instead of each.
Applying those to your code, you get this:
DICT=File.readlines("unixdict.txt").collect(&:chomp) i = 0 res = DICT.collect(&:reverse).sort.select { |z| i+=1 while z > DICT[i] and i < DICT.length-1 z == DICT[i] and z < z.reverse }
Hope you find the above useful or at least interesting. --Markjreed (talk) 10:20, 15 May 2013 (UTC)
- Thanks for the interest. The manual tr was put in by Paddy3118 so I take no credit for it and I am more than happy to make the change. Spoon! then changed it to use a set in immitation of the Python. I wasn't happy about that!, walking sorted files seemed good to me. C has since implemented that to perfection. The each seems more natural to me, in the real world I would probably want to write these pairs to a file or something, but for the purpose of this example why not?--Nigel Galloway (talk) 12:09, 17 May 2013 (UTC)
Abandoned Task: Blackjack strategy
Hi Nigel, you might revive it by adding its first implementation...
--Paddy3118 (talk) 11:24, 12 November 2014 (UTC)
Discussions on your new task Textonyms
Hi Nigel, I wondered if you could join in the discussions at Talk:Textonyms thanks. --Paddy3118 (talk) 07:46, 6 February 2015 (UTC)