--- Begin Message ---Just realized that String>>#asNumber works differently in Pharo and in Squeak.'+3' asNumber "Works in Squeak, not in Pharo" BUT '+3' asInteger "Works in both Squeak and Pharo" ----------------- Benoît St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean Instagram: Chef_Benito IRC: lamneth Blogue: endormitoire.wordpress.com "A standpoint is an intellectual horizon of radius zero". (A. Einstein) On Sunday, December 2, 2018, 11:06:56 a.m. EST, p...@highoctane.be <p...@highoctane.be> wrote: I am not using a file, but copy/paste my puzzleInput into a puzzleInput method. Then I use lines from there. e.g. shifts ^ self puzzleInput lines collect: [ :each | ((each beginsWith: '+') ifTrue: [ each allButFirst ] ifFalse: [ each ]) asNumber ] Because the challenge is personalized and it is annoying to have to commit a supplementary file in the github repository. Phil On Sun, Dec 2, 2018 at 3:27 PM Benoit St-Jean via Pharo-users <pharo-users@lists.pharo.org> wrote: Exactly! It's easier to manipulate that OrderedCollection that to open/reopen the file. It'll be VERY handy for problem #2 where you will need to iterate multiple times on the data! ;) ----------------- Benoît St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean Instagram: Chef_Benito IRC: lamneth Blogue: endormitoire.wordpress.com "A standpoint is an intellectual horizon of radius zero". (A. Einstein) On Sunday, December 2, 2018, 7:15:06 a.m. EST, Roelof Wobben <r.wob...@home.nl> wrote: Op 2-12-2018 om 12:19 schreef Benoit St-Jean via Pharo-users: oke, and if I understand your code files is then the variable that holds the file. Roelof
--- End Message ---
Re: [Pharo-users] How to take care that the + before a number is ignored
Benoit St-Jean via Pharo-users Sun, 02 Dec 2018 08:18:47 -0800
- Re: [Pharo-users] How to take ... Roelof Wobben
- Re: [Pharo-users] How to t... Benoit St-Jean via Pharo-users
- Re: [Pharo-users] How... Sven Van Caekenberghe
- Re: [Pharo-users]... Benoit St-Jean via Pharo-users
- Re: [Pharo-users] How to t... Sven Van Caekenberghe
- Re: [Pharo-users] How to t... Benoit St-Jean via Pharo-users
- Re: [Pharo-users] How... Roelof Wobben
- Re: [Pharo-users]... Benoit St-Jean via Pharo-users
- Re: [Pharo-users]... phil--- via Pharo-users
- Re: [Pharo-users]... Roelof Wobben
- Re: [Pharo-users]... Benoit St-Jean via Pharo-users
- Re: [Pharo-users] How to take care that the... Ben Coman