Groups | Search | Server Info | Login | Register
Groups > comp.lang.forth > #23731
| Newsgroups | comp.lang.forth |
|---|---|
| Date | 2013-06-17 16:19 -0700 |
| References | <kpnsb3$g6d$1@dont-email.me> |
| Message-ID | <4796c298-c8fc-4ff0-a6da-8ed649ccab71@googlegroups.com> (permalink) |
| Subject | Re: Trickier sorting |
| From | Pablo Hugo Reda <pabloreda@gmail.com> |
El lunes, 17 de junio de 2013 17:42:13 UTC-3, WJ escribió:
> Sort a list of strings by the integer within parentheses.
>
>
>
> Ruby:
>
>
>
> puts "
>
> vileness, inc. (31)
>
> undreamed of bores (48)
>
> a glimpse of (99)
>
> range #2 (75)
>
> rider (23)
>
> ".strip.split( /\s*\n\s*/ ).sort_by{|s| s[ /\(\d+\)/ ][1..-1].to_i }
>
>
>
> ==>
>
>
>
> rider (23)
>
> vileness, inc. (31)
>
> undreamed of bores (48)
>
> range #2 (75)
>
> a glimpse of (99)
>
>
>
>
>
> Is it practical to do this in Forth?
>
> Or is Forth merely a stone-age toy?
I don't see toy languaje,
I see toy problems
please, don't spend time here, make real programs or a cake for example
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar
Trickier sorting "WJ" <w_a_x_man@yahoo.com> - 2013-06-17 20:42 +0000
Re: Trickier sorting "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-06-17 19:02 -0400
Re: Trickier sorting Elizabeth D Rather <erather@forth.com> - 2013-06-17 13:14 -1000
Re: Trickier sorting anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 08:03 +0000
Re: Trickier sorting Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 04:28 -0500
Re: Trickier sorting Pablo Hugo Reda <pabloreda@gmail.com> - 2013-06-17 16:19 -0700
Re: Trickier sorting hughaguilar96@yahoo.com - 2013-06-18 17:38 -0700
Re: Trickier sorting hughaguilar96@yahoo.com - 2013-06-18 17:21 -0700
Re: Trickier sorting Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-06-19 13:43 +0000
csiph-web