Re: [Pharo-users] [Pharo-dev] [ANN] Pharo 7.0.3

2019-04-13 Thread Esteban Lorenzano
Hi Tim, 

Is not about subprojects, is about hot fixes :)
Pharo 7 will continue having some updates on critical bugs but it should not 
include regular changes (like an update on Calypso). 
In that sense, fix #2781 sneaked in and it shouldn’t, which means we still need 
to adjust the process :P

Esteban
 

> On 13 Apr 2019, at 14:50, Tim Mackinnon  wrote:
> 
> This is great - I’m pleased we can get fixes like this (and keen to get 
> passed that font issue which was driving me crazy).
> 
> A small related question - how do ensure we get fixes from sub projects 
> considered too? I’d really like to see: 
> https://github.com/pharo-ide/Calypso/pull/451 
>  as it’s annoying not being 
> able to move methods between classes. There are a few other Calypso gems in 
> there too (and quite a few more to fix).
> 
> I worry that having all these sub-projects makes it a bit complicated to get 
> them included?
> 
> Tim
> 
> Sent from my iPhone
> 
> On 12 Apr 2019, at 16:26, "teso...@gmail.com " 
> mailto:teso...@gmail.com>> wrote:
> 
>> Pharo 7.0.3 contains several bugfixes, notably a fix for the annoying font 
>> corruption font.
>> 
>> 
>> 
>> Changes Log
>> 
>> #2781  Fix comment on 
>> OSWindow >> startTextInput
>> #3160  
>> 2975-Problem-when-you-read-an-mcz-pharo7
>> #3130  Improving the 
>> performance of SourceFileArray
>> #3164  MailMessage can not 
>> send mails with attachment in Pharo7
>> #3149  
>> 3148-backport-2395-to-Pharo-70--Non-ASCII-class-and-author-names-break-SourceFileArraygetPreambleFromat
>> #3178  Fix for corrupted 
>> fonts in Pharo7
>> Detailed Diff: v7.0.2...pharo-project:v7.0.3 
>> 
>> https://github.com/pharo-project/pharo/releases/tag/v7.0.3 
>> 
>> All the images are available in ZeroConf and in the Pharo Launcher.
>> 
>> Thanks to all the collaborators especially: 
>> 
>> - David 
>> - Guille
>> - Pavel
>> - Christophe
>> - Theo
>> - Sabine
>> - Sven
>> 
>> And to all the people that helped to make this release in a couple of 
>> minutes. 
>> And thanks to the academy! 
>> 
>> Pablo



Re: [Pharo-users] [Pharo-dev] [ANN] Pharo 7.0.3

2019-04-13 Thread Tim Mackinnon
This is great - I’m pleased we can get fixes like this (and keen to get passed 
that font issue which was driving me crazy).

A small related question - how do ensure we get fixes from sub projects 
considered too? I’d really like to see: 
https://github.com/pharo-ide/Calypso/pull/451 as it’s annoying not being able 
to move methods between classes. There are a few other Calypso gems in there 
too (and quite a few more to fix).

I worry that having all these sub-projects makes it a bit complicated to get 
them included?

Tim

Sent from my iPhone

> On 12 Apr 2019, at 16:26, "teso...@gmail.com"  wrote:
> 
> Pharo 7.0.3 contains several bugfixes, notably a fix for the annoying font 
> corruption font.
> 
> 
> 
> Changes Log
> 
> #2781 Fix comment on OSWindow >> startTextInput
> #3160 2975-Problem-when-you-read-an-mcz-pharo7
> #3130 Improving the performance of SourceFileArray
> #3164 MailMessage can not send mails with attachment in Pharo7
> #3149 
> 3148-backport-2395-to-Pharo-70--Non-ASCII-class-and-author-names-break-SourceFileArraygetPreambleFromat
> #3178 Fix for corrupted fonts in Pharo7
> Detailed Diff: v7.0.2...pharo-project:v7.0.3
> https://github.com/pharo-project/pharo/releases/tag/v7.0.3
> 
> All the images are available in ZeroConf and in the Pharo Launcher.
> 
> Thanks to all the collaborators especially: 
> 
> - David 
> - Guille
> - Pavel
> - Christophe
> - Theo
> - Sabine
> - Sven
> 
> And to all the people that helped to make this release in a couple of 
> minutes. 
> And thanks to the academy! 
> 
> Pablo


Re: [Pharo-users] is this a valid Smalltalk way

2019-04-13 Thread Roelof Wobben

  
  
Hello Richard, 
  
  I do it afterwards the input looks like this : 
  
  #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 3 7).
  
  and I solved it already like this :  
  
  scoreAfterRolling: aCollection
      | score |
      score := 0.
      1 to: aCollection size - 1 by: 2 do: [ :index | 
          score := (aCollection at: index) = 10
              ifTrue:
                  [ score + 10 + (aCollection at: index + 1) +
  aCollection at: index + 2 ]
              ifFalse: [ (aCollection at: index) + (aCollection at:
  index + 1) = 10
                      ifTrue: [ score + 10 + aCollection at: index +
  2 ]
                      ifFalse: [ score + (aCollection at: index) +
  (aCollection at: index + 1) ] ] ].
      ^ score
  
  
  but the problem I facing now that I see when someone throws a
  strike I do not need a step of 2 but a step of 1 
  I tried to make a custom step variable but that did not do the 
  job. 
  
  So right now thinking how to get out of this 
  
  Roelof
  
  
  
  
  
  Op 13-4-2019 om 11:37 schreef Richard O'Keefe:


  
  You wrote: "a frame is always two times a throw"
but the specification says "A frame is composed of one or two
ball throws"
and later we learn that the 10th frame may have three throws.


There is an issue with your Smalltalk.
aCollection withIndexDo: [:index :item |
  "You have the arguments in the wrong order.
   It is :item then :index"
   ...
   index := index + 2 "this is not legal"].
The assignment is not legal because you are not allowed
to assign to method parameters or block parameters.

You're going to have something like this:
  game := BowlingGame new.
  ... game roll: nPins.
  score := game score.
Since the score of a strike or a spare depends on the
scores of the *next* two throws, it might be easier to
process the throws backwards.


On Sat, 13 Apr 2019 at 04:32, Roelof Wobben 
wrote:
>
> Hello,
>
> Im thinking how to solve this one :
> https://github.com/exercism/problem-specifications/blob/master/exercises/bowling/description.md
>
> so I thought because you throw two times for a frame to
solve it like
> this :
>
>
> aCollection withIndexDo: [:index :item |
>     (if spare) ifTrue: take 3 items out of the score
collection and sum
> them up
>     (if strike) ifTrue: take 4 items out of the score
collection and sum
> them up.
>     (if not a spare and not a strike) : ifTrue:  take 2
items out of the
> score collection and sum them up.
>     index := index + 2  // because  a frame is always two
times a throw
>
>
> Now I wonder if this is a valid smalltalk to do this
>
> Roelof
>
>
  


  




Re: [Pharo-users] is this a valid Smalltalk way

2019-04-13 Thread Richard O'Keefe
You wrote: "a frame is always two times a throw"
but the specification says "A frame is composed of one or two ball throws"
and later we learn that the 10th frame may have three throws.


There is an issue with your Smalltalk.
aCollection withIndexDo: [:index :item |
  "You have the arguments in the wrong order.
   It is :item then :index"
   ...
   index := index + 2 "this is not legal"].
The assignment is not legal because you are not allowed
to assign to method parameters or block parameters.

You're going to have something like this:
  game := BowlingGame new.
  ... game roll: nPins.
  score := game score.
Since the score of a strike or a spare depends on the
scores of the *next* two throws, it might be easier to
process the throws backwards.


On Sat, 13 Apr 2019 at 04:32, Roelof Wobben  wrote:
>
> Hello,
>
> Im thinking how to solve this one :
>
https://github.com/exercism/problem-specifications/blob/master/exercises/bowling/description.md
>
> so I thought because you throw two times for a frame to solve it like
> this :
>
>
> aCollection withIndexDo: [:index :item |
> (if spare) ifTrue: take 3 items out of the score collection and sum
> them up
> (if strike) ifTrue: take 4 items out of the score collection and sum
> them up.
> (if not a spare and not a strike) : ifTrue:  take 2 items out of the
> score collection and sum them up.
> index := index + 2  // because  a frame is always two times a throw
>
>
> Now I wonder if this is a valid smalltalk to do this
>
> Roelof
>
>