'From etoys3.0 of 24 February 2008 [latest update: #1939] on 28 March 2008 at 2:40:44 am'! "Change Set: transGame-KR Date: 28 March 2008 Author: Korakurider translate Games"! !ChessMorph methodsFor: 'initialize' stamp: 'KR 3/28/2008 02:22'! addButtonRow | r m | r _ AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap; color: Color transparent. r addMorphBack: (self buttonName: ' New ' translated action: #newGame). r addMorphBack: (self buttonName: ' Help ' translated action: #findBestMove). r addMorphBack: (self buttonName: ' Play ' translated action: #thinkAndMove). r addMorphBack: (self buttonName: ' Auto ' translated action: #autoPlay). r addMorphBack: (self buttonName: ' Undo ' translated action: #undoMove). r addMorphBack: (self buttonName: ' Redo ' translated action: #redoMove). r addMorphBack: (self buttonName: ' Quit ' translated action: #delete). r disableTableLayout: true. r align: r bounds topLeft with: self layoutBounds topLeft. self addMorphFront: r. m _ UpdatingStringMorph on: self selector: #statusString. m useStringFormat. m disableTableLayout: true. m align: m bounds topLeft with: r fullBounds bottomLeft. self addMorphFront: m.! ! !ChessMorph methodsFor: 'playing' stamp: 'KR 3/28/2008 02:23'! findBestMove | move | board searchAgent isThinking ifTrue:[^self]. Cursor wait showWhile:[move _ board searchAgent think]. self inform: 'I suggest: ' translated, move printString. ^move! ! !ChineseCheckers methodsFor: 'menu' stamp: 'KR 3/28/2008 02:17'! addMenuItemsTo: aMenu hand: aHandMorph aMenu add: 'new game' translated target: self action: #newGame. aMenu add: 'reset...' translated target: self action: #reset. animateMoves ifTrue: [aMenu add: 'don''t animate moves' translated target: self action: #dontAnimateMoves] ifFalse: [aMenu add: 'animate moves' translated target: self action: #animateMoves] ! ! !ChineseCheckers methodsFor: 'menu' stamp: 'KR 3/28/2008 02:18'! reset "Reset the board, choosing anew how many teams." | nPlayers nHumans | nPlayers _ (SelectionMenu selections: (1 to: 6)) startUpWithCaption: 'How many players?' translated. nPlayers ifNil: [nPlayers _ 2]. nHumans _ (SelectionMenu selections: (0 to: nPlayers)) startUpWithCaption: 'How many humans?' translated. nHumans ifNil: [nHumans _ 1]. self teams: (#((1) (2 5) (2 4 6) (1 2 4 5) (1 2 3 4 6) (1 2 3 4 5 6)) at: nPlayers) autoPlay: ((1 to: nPlayers) collect: [:i | i > nHumans]). ! ! !CipherPanel methodsFor: 'menu' stamp: 'KR 3/28/2008 02:31'! buttonRow | row aButton | row := AlignmentMorph newRow color: self color; hResizing: #shrinkWrap; vResizing: #shrinkWrap. #('show help' 'show hints' 'clear typing' 'enter a new cipher' 'quote from Squeak' ) translatedNoop with: #(#showHelpWindow #showHintsWindow #clearTyping #enterANewCipher #squeakCipher ) do: [:label :selector | aButton := SimpleButtonMorph new target: self. aButton color: Color transparent; borderWidth: 1; borderColor: Color black. aButton actionSelector: selector. aButton label: label translated. row addMorphBack: aButton. row addTransparentSpacerOfSize: 3 @ 0]. ^ row! ! !CrosticPanel methodsFor: 'menu' stamp: 'KR 3/28/2008 02:37'! buttonRow | row aButton | row := AlignmentMorph newRow color: self color; hResizing: #shrinkWrap; vResizing: #shrinkWrap. #('show help' 'show errors' 'show hints' 'clear' 'open...' ) translatedNoop with: #(#showHelpWindow #showErrors #showHintsWindow #clearTyping #openFile ) do: [:label :selector | aButton := SimpleButtonMorph new target: self. aButton color: Color transparent; borderWidth: 1; borderColor: Color black. aButton actionSelector: selector. aButton label: label translated. row addMorphBack: aButton. row addTransparentSpacerOfSize: 3 @ 0]. ^ row! ! !FreeCellStatistics methodsFor: 'user interface' stamp: 'KR 3/28/2008 02:11'! makeOkButton ^self buildButton: SimpleButtonMorph new target: self label: 'OK' translated selector: #ok! ! !FreeCellStatistics methodsFor: 'user interface' stamp: 'KR 3/28/2008 02:11'! makeResetButton ^self buildButton: SimpleButtonMorph new target: self label: 'Reset' translated selector: #reset! ! !FreeCellStatistics methodsFor: 'printing' stamp: 'KR 3/28/2008 02:13'! printStreaksOn: aStream aStream nextPutAll: 'Streaks: ' translated; tab; tab. self print: streakWins type: #wins on: aStream. aStream nextPutAll: ', '. self print: streakLosses type: #losses on: aStream. aStream cr; tab; tab; tab; tab; nextPutAll: 'Current: ' translated. self print: currentCount type: currentType on: aStream! ! !SameGame methodsFor: 'initialization' stamp: 'KR 3/28/2008 02:33'! makeControls | row | row _ AlignmentMorph newRow color: color; borderWidth: 0; layoutInset: 3. row hResizing: #spaceFill; vResizing: #shrinkWrap; wrapCentering: #center; cellPositioning: #leftCenter; extent: 5@5. row addMorph: (self buildButton: SimpleSwitchMorph new target: self label: 'Help' translated selector: #help:). row addMorph: (self buildButton: SimpleButtonMorph new target: self label: 'Quit' translated selector: #delete). row addMorph: (self buildButton: SimpleButtonMorph new target: self board label: 'Hint' translated selector: #hint). row addMorph: (self buildButton: SimpleButtonMorph new target: self label: 'New game' translated selector: #newGame). selectionDisplay _ LedMorph new digits: 2; extent: (2*10@15). row addMorph: (self wrapPanel: selectionDisplay label: 'Selection:' translated). scoreDisplay _ LedMorph new digits: 4; extent: (4*10@15). row addMorph: (self wrapPanel: scoreDisplay label: 'Score:' translated). ^ row! !