Re: [Pharo-users] Little challenges for a friday evening

2016-11-13 Thread stepharo
it leads to a 4-5x performance loss . *From:*Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On Behalf Of *Damien Pollet *Sent:* Friday, November 11, 2016 4:14 PM *To:* Any question about pharo is welcome *Subject:* Re: [Pharo-users] Little challenges for a friday evening On 11 Nov

Re: [Pharo-users] Little challenges for a friday evening

2016-11-13 Thread stepharo
A nice read. What audience is it aimed at? Difficult question :) First or second year students and more. So with and without a Java lecture before. But the guy should know how to program a bit I told you that it was fuzzy Some grammar suggestions... Oh I'm sure that they are

Re: [Pharo-users] Little challenges for a friday evening

2016-11-12 Thread Ben Coman
A nice read. What audience is it aimed at? Some grammar suggestions... > Sets are collections that only contains one element. Being pedantic ;) the following Set does more than "contain one element"... (Set new) add: 1; add: 2. so maybe... "Sets are unordered collections where elements d

Re: [Pharo-users] Little challenges for a friday evening

2016-11-12 Thread stepharo
I love all these solutions!!! Thank for you for such cool but compact discussions! I did a check to see how I could get isograms for french so over a dictionary of 30 entities around 5 are and I got really surprised because stupily I was counting é, ê, e and è as the same letter and wel

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread Henrik Nergaard
).” Then it leads to a 4-5x performance loss . From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Damien Pollet Sent: Friday, November 11, 2016 4:14 PM To: Any question about pharo is welcome Subject: Re: [Pharo-users] Little challenges for a friday evening On 11 November

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread Damien Pollet
On 11 November 2016 at 12:02, stepharo wrote: > String>>#isIsogram >> | letters | >> letters := Dictionary new. >> self do: [ :x | letters at: x ifAbsent: [] ifPresent: [ ^false ]. >> > Yes I did that one too and I was surprised because it was as slow as the > bag implementation. >

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread stepharo
---Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Sven Van Caekenberghe Sent: Thursday, November 10, 2016 11:10 PM To: Any question about pharo is welcome Subject: Re: [Pharo-users] Little challenges for a friday evening [ :string | string siz

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread stepharo
en Van Caekenberghe Sent: Thursday, November 10, 2016 11:10 PM To: Any question about pharo is welcome Subject: Re: [Pharo-users] Little challenges for a friday evening [ :string | string size = string asSet size ] value: 'Pharo'. true [ :string | string size = string asSet size ] value: &

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread stepharo
Le 11/11/16 à 01:09, Ben Coman a écrit : First I've heard of an isogram. Wikipedia [1] is ambiguous. Are you considering only single occurrence of letters, or also equal occurrence of letters. I like Sven's answer best, but just as an exercise I thought of an alternative. String>>#isIsogram

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Ben Coman
First I've heard of an isogram. Wikipedia [1] is ambiguous. Are you considering only single occurrence of letters, or also equal occurrence of letters. I like Sven's answer best, but just as an exercise I thought of an alternative. String>>#isIsogram | letters | letters := Dictionary new

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Henrik Nergaard
false ] ]. ^ true -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Sven Van Caekenberghe Sent: Thursday, November 10, 2016 11:10 PM To: Any question about pharo is welcome Subject: Re: [Pharo-users] Little challenges for a friday evening [ :

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Sven Van Caekenberghe
you're right, should probably be case insensitive. > On 10 Nov 2016, at 23:14, Cyril Ferlicot D. wrote: > > Le 10/11/2016 à 23:09, Sven Van Caekenberghe a écrit : >> [ :string | string size = string asSet size ] value: 'Pharo'. >> > true >> >> [ :string | string size = string asSet size ]

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Cyril Ferlicot D.
Le 10/11/2016 à 23:09, Sven Van Caekenberghe a écrit : > [ :string | string size = string asSet size ] value: 'Pharo'. > true > > [ :string | string size = string asSet size ] value: 'Pharoo'. > false > > String>>#isIsogram > ^ self size = self asSet size > > ? > 'Pharop' size =

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Sven Van Caekenberghe
[ :string | string size = string asSet size ] value: 'Pharo'. >>> true [ :string | string size = string asSet size ] value: 'Pharoo'. >>> false String>>#isIsogram ^ self size = self asSet size ? > On 10 Nov 2016, at 22:19, stepharo wrote: > > Hi > > I'm checking how I would implement an