diff options
| author | Michael <mr.michael.racz@gmail.com> | 2011-05-15 18:45:29 +0200 |
|---|---|---|
| committer | Michael <mr.michael.racz@gmail.com> | 2011-05-15 18:45:29 +0200 |
| commit | d18913daf2be1267e52a2ba7400b533da7003d1d (patch) | |
| tree | 667baf97e3c253680693886699236bf45bbbc582 /pacman-smalltalk | |
| parent | a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec (diff) | |
| download | foop-d18913daf2be1267e52a2ba7400b533da7003d1d.tar.gz foop-d18913daf2be1267e52a2ba7400b533da7003d1d.tar.bz2 foop-d18913daf2be1267e52a2ba7400b533da7003d1d.zip | |
removed unnesecary classes
Diffstat (limited to 'pacman-smalltalk')
| -rw-r--r-- | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes | 2 | ||||
| -rw-r--r-- | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image | bin | 14915180 -> 15393456 bytes |
2 files changed, 1 insertions, 1 deletions
diff --git a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes index ba0bf2c..5c1563e 100644 --- a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes +++ b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes | |||
| @@ -1 +1 @@ | |||
| 'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 17 April 2010 at 5:22:05 pm'! ----STARTUP----{17 April 2010 . 5:21:54 pm} as C:\Squeak\4.0\4.1-final\Squeak4.1.image! Smalltalk appendChangesTo: 'SqueakV41.sources'.! ----QUIT----{17 April 2010 . 5:22:11 pm} Squeak4.1.image priorSource: 89! ----STARTUP----{18 April 2010 . 5:57:27 pm} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! !BlockContextTest methodsFor: 'running' stamp: 'md 9/6/2005 19:56' prior: 50431957! setUp super setUp. aBlockContext := [100@100 corner: 200@200]. contextOfaBlockContext := thisContext.! ! !BehaviorTest methodsFor: 'tests' stamp: 'md 2/18/2006 16:42' prior: 17365994! testBinding self assert: Object binding value = Object. self assert: Object binding key = #Object. self assert: Object class binding value = Object class. "returns nil for Metaclasses... like Encoder>>#associationFor:" self assert: Object class binding key = nil.! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53956757! testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #EmbeddedSourceQCompress ). self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer sourceCode: code. self assert: (trailer kind == #EmbeddedSourceZip ). newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53957691! testEmbeddingTempNames | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer tempNames: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #TempsNamesQCompress ). self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer tempNames: code. self assert: (trailer kind == #TempsNamesZip ). newTrailer := trailer testEncoding. self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:17' prior: 53958613! testEncodingNoTrailer | trailer | trailer := CompiledMethodTrailer new. "by default it should be a no-trailer" self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:14' prior: 53959109! testEncodingSourcePointer | trailer | trailer := CompiledMethodTrailer new. CompiledMethod allInstancesDo: [:method | | ptr | trailer method: method. self assert: ( (ptr := method sourcePointer) == trailer sourcePointer). "the last bytecode index must be at 0" ptr ~= 0 ifTrue: [ self assert: (method endPC = trailer endPC) ]. ].! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53959564! testEncodingVarLengthSourcePointer | trailer newTrailer | trailer := CompiledMethodTrailer new. trailer sourcePointer: 1. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 1). trailer sourcePointer: 16r100000000000000. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 16r100000000000000). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53960108! testSourceByIdentifierEncoding | trailer id | trailer := CompiledMethodTrailer new. id := UUID new asString. trailer sourceIdentifier: id. self assert: (trailer kind == #SourceByStringIdentifier ). trailer := trailer testEncoding. self assert: (trailer kind == #SourceByStringIdentifier ). self assert: (trailer sourceIdentifier = id). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:49' prior: 53960643! testSourceBySelectorEncoding | trailer | trailer := CompiledMethodTrailer new. trailer setSourceBySelector. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CategorizerTest methodsFor: 'running' stamp: 'mtf 9/10/2007 10:10' prior: 18074036! setUp categorizer := Categorizer defaultList: #(a b c d e). categorizer classifyAll: #(a b c) under: 'abc'. categorizer addCategory: 'unreal'.! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074267! testClassifyNewElementNewCategory categorizer classify: #f under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') (''nice'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:18' prior: 18074541! testClassifyNewElementOldCategory categorizer classify: #f under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074806! testClassifyOldElementNewCategory categorizer classify: #e under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'') (''nice'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:54' prior: 18075078! testClassifyOldElementOldCategory categorizer classify: #e under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:22' prior: 18075341! testDefaultCategoryIsTransient "Test that category 'as yet unclassified' disapears when all it's elements are removed'" categorizer classifyAll: #(d e) under: #abc. self assert: categorizer printString = '(''abc'' a b c d e) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 15:15' prior: 18075669! testNullCategory "Test that category 'as yet unclassified' disapears when all it's elements are removed'" | aCategorizer | aCategorizer := Categorizer defaultList: #(). self assert: aCategorizer printString = '(''as yet unclassified'') '. self assert: aCategorizer categories = #('no messages'). aCategorizer classify: #a under: #b. self assert: aCategorizer printString = '(''b'' a) '. self assert: aCategorizer categories = #(b).! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18076194! testRemoveEmptyCategory categorizer removeCategory: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:55' prior: 18076430! testRemoveExistingElement categorizer removeElement: #a. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076673! testRemoveNonEmptyCategory self should: [categorizer removeCategory: #abc] raise: Error. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076950! testRemoveNonExistingCategory categorizer removeCategory: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18077203! testRemoveNonExistingElement categorizer removeElement: #f. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 14:49' prior: 18077451! testRemoveThenRename categorizer removeCategory: #unreal. categorizer renameCategory: #abc toBe: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''unreal'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:14' prior: 18077736! testUnchanged self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! "KernelTests"! !SMLoaderPlus commentStamp: 'btr 12/1/2006 15:16' prior: 0! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). It uses ToolBuilder to construct its window. You can open one with: SMLoaderPlus open Instance Variables categoriesToFilterIds: <OrderedCollection> The set of categories to filter the packages list. filters: <OrderedCollection> The set of filters to apply to the packages list. map: <SMSqueakMap> The model SqueakMap. packagesList: <OrderedCollection> The list of packages from the map. selectedCategory: <SMCategory> The current category. selectedItem: <SMPackage> The selected package or release. window: <PluggableSystemWindow> The window, held only so we can reOpen.! !SMLoaderCategoricalPlus commentStamp: 'btr 12/4/2006 15:47' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategoricalPlus open! !SMLoader commentStamp: 'btr 11/30/2006 18:00' prior: 27913009! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). You can open one with: SMLoader open! !SMLoaderCategorical commentStamp: 'btr 12/1/2006 15:16' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategorical open! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifPresent: [:tb | (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:50'! buildFancyWith: aBuilder "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)); yourself); add: ((self buildNotInstalledPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ (horizDivide / 2)); yourself); add: ((self buildInstalledPackagesListWith: builder) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide); yourself); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1); yourself); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. self setUpdatablePanesFrom: #(#installedPackageList #notInstalledPackageList ). currentPackageList := #notInstalled. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:56'! buildInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #installedPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:52'! buildNotInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #notInstalledPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:55'! buildWith: aBuilder | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight))); add: ((self buildPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide)); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1)); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList ^currentPackageList! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:55'! defaultLabel ^ 'Categorical ' , super defaultLabel! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:52'! installedPackageList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! installedPackagesListIndex ^ self currentPackageList = #installed ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! isOn ^false! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:53'! notInstalledPackageList ^self packageList reject: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! notInstalledPackagesListIndex ^ self currentPackageList = #notInstalled ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:03'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategoricalPlus methodsFor: 'private' stamp: 'btr 12/1/2006 17:53'! noteChanged self changed: #installedPackageList. self changed: #notInstalledPackageList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:34'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! !SMLoaderPlus class methodsFor: 'parts bin' stamp: 'btr 11/22/2006 15:02'! descriptionForPartsBin ^self partName: 'Package Loader' categories: #(Tools) documentation: 'SqueakMap UI' ! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47'! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifPresent: [:tb | self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white "not set" ifTrue: [ Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor) ]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! initializedInstance ^ (ToolBuilder open: self new) extent: 400@400! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! new "Create a SqueakMap loader on the default map." ^self newOn: SMSqueakMap default! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! newOn: aMap "Create a SqueakMap loader on given map." ^super new on: aMap; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! newStandAlone ^ ToolBuilder open: self new! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:13'! open "Create and open a SqueakMap Loader." "SMLoaderPlus open" ^ (Smalltalk at: #ToolBuilder) open: self new! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:21'! openOn: aSqueakMap "Create and open a SqueakMap Loader on a given map." "self openOn: SqueakMap default" ^ (Smalltalk at: #ToolBuilder) open: (self newOn: aSqueakMap)! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:18'! prototypicalToolWindow ^ ToolBuilder open: self new; applyModelExtent; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:02'! registerInFlapsRegistry "Register the receiver in the system's flaps registry." self environment at: #Flaps ifPresent: [:cl | (cl respondsTo: #registerQuad:forFlapNamed:) ifTrue: [cl registerQuad: #(#SMLoader #prototypicalToolWindow 'Package Loader' 'The SqueakMap Package Loader' ) forFlapNamed: 'Tools']]! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoaderPlus class methodsFor: 'window color' stamp: 'btr 11/22/2006 15:02'! windowColorSpecification "Answer a WindowColorSpec object that declares my preference." ^WindowColorSpec classSymbol: self name wording: 'Package Loader' brightColor: Color yellow muchLighter duller pastelColor: Color yellow veryMuchLighter duller helpMessage: 'The SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! addSelectedCategoryAsFilter "Add a new filter that filters on the currently selected category. Make it enabled as default." categoriesToFilterIds add: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 16:11'! askToLoadUpdates "Check how old the map is and ask to update it if it is older than 10 days or if there is no map on disk." | available | available := map isCheckpointAvailable. (available not or: [ (Date today subtractDate: (Date fromSeconds: (map directory directoryEntryFor: map lastCheckpointFilename) modificationTime)) > 3]) ifTrue: [ (self confirm: (available ifTrue: ['The map on disk is more than 10 days old, update it from the Internet?'] ifFalse: ['There is no map on disk, fetch it from the Internet?'])) ifTrue: [self loadUpdates]]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:43'! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. dir := item isPackage ifTrue: [map cache directoryForPackage: item] ifFalse: [map cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. "withLabel: item name, ' cache directory'." win openInWorld! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildButtonBarWith: aBuilder ^ aBuilder pluggablePanelSpec new model: self; layout: #horizontal; children: (self commandSpecs select: [ :spec | spec fourth includes: #all] thenCollect: [ :spec | aBuilder pluggableActionButtonSpec new model: self; label: spec first; action: spec second; help: spec third; enabled: ((spec fourth includes: #item) ifTrue: [#hasSelectedItem]); yourself]); name: #buttonBar; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildCategoriesListWith: aBuilder "Create the hierarchical list holding the category tree." ^ aBuilder pluggableTreeSpec new model: self; roots: #categoryList; getSelectedPath: #selectedCategoryPath; getChildren: #categoryChildren:; hasChildren: #categoryHasChildren:; setSelected: #selectedCategory:; menu: #categoriesMenu:; label: #categoryLabel:; autoDeselect: true; wantsDrop: true; name: #categoriesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagePaneWith: aBuilder "Create the text area to the right in the loader." ^ aBuilder pluggableTextSpec new model: self; getText: #itemDescription; name: #packagePane; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagesListWith: aBuilder "Create the hierarchical list holding the packages and releases." ^ aBuilder pluggableTreeSpec new model: self; roots: #packageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; name: #packagesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildSearchPaneWith: aBuilder ^ aBuilder pluggableInputFieldSpec new model: self; selection: #searchSelection; getText: #searchText; setText: #findPackage:notifying:; name: #search; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:54'! buildWith: aBuilder "Create the package loader window." | buttonBarHeight vertDivide horizDivide | buttonBarHeight := 0.07. vertDivide := 0.6. horizDivide := 0.3. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight)); add: ((self buildSearchPaneWith: builder) frame: (0 @ buttonBarHeight corner: horizDivide @ (buttonBarHeight * 2))); add: ((self buildPackagesListWith: builder) frame: (0 @ (buttonBarHeight * 2) corner: horizDivide @ vertDivide)); add: ((self buildCategoriesListWith: builder) frame: (0 @ vertDivide corner: horizDivide @ 1)); add: ((self buildPackagePaneWith: builder) frame: (horizDivide @ buttonBarHeight corner: 1 @ 1)); yourself); yourself). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! cachePackageReleaseAndOfferToCopy "Cache package release, then offer to copy it somewhere. Answer the chosen file's location after copy, or the cache location if no directory was chosen." | release installer newDir newName newFile oldFile oldName | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. installer := SMInstaller forPackageRelease: release. [UIManager default informUser: 'Caching ' , release asString during: [installer cache]] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs. ^nil ]. installer isCached ifFalse: [self inform: 'Download failed, see transcript for details'. ^nil]. oldName := installer fullFileName. newDir := FileList2 modalFolderSelector: installer directory. newDir ifNil: [ ^oldName ]. newDir = installer directory ifTrue: [ ^oldName ]. newName := newDir fullNameFor: installer fileName. newFile := FileStream newFileNamed: newName. newFile ifNil: [ ^oldName ]. newFile binary. oldFile := FileStream readOnlyFileNamed: oldName. oldFile ifNil: [ ^nil ]. oldFile binary. [[ newDir copyFile: oldFile toFile: newFile ] ensure: [ oldFile close. newFile close ]] on: Error do: [ :ex | ^oldName ]. ^newName! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categoriesMenu: aMenu "Answer the categories-list menu." self selectedCategory ifNotNil: [aMenu addList: self categorySpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! categoryChildren: aCategory ^ aCategory subCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! categoryHasChildren: aCategory ^ aCategory hasSubCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:46'! categoryLabel: aCategory ^ aCategory name! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01'! categoryList "Create the category list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (map categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/22/2006 15:02'! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:01'! commandSpecFor: selector ^ self commandSpecs detect: [:spec | spec second = selector]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:00'! commandSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.' (item all)) ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.' (item all)) ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.' (item all)) ('Copy from cache' cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' (item)) ('Force download into cache' downloadPackageRelease 'Force a download of the selected release into the cache.' (item)) ('Update' loadUpdates 'Update the package index from the servers.' (all)) ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (conf8irming each).' (all)) ('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm '' (item)) ('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm '' (item)) ('Copy list' listInPasteBuffer 'Puts the list as text into the clipboard.' (all)) ('Save filters' saveFiltersAsDefault 'Saves the current filters as default.' (all)) ('Help' help 'What is this?' (all)))! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! defaultLabel ^ 'SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! downloadPackageRelease "Force a download of the selected package release into the cache." | release | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. [UIManager default informUser: 'Downloading ' , release asString during: [ (SMInstaller forPackageRelease: release) download] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterAdd: anObject self changeFilters: (self filters copyWith: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterAutoInstall ^[:package | package isInstallable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterAvailable ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterInstalled ^[:package | package isInstalled]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterNotInstalledYet ^[:package | package isInstalled not]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterNotUptoDate ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterPublished ^[:package | package isPublished]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterRemove: anObject self changeFilters: (self filters copyWithout: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterSafelyAvailable ^[:package | package isSafelyAvailable]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/30/2006 21:07'! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #(#('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.') ) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ' , (map object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterVersion "Ignore spaces in the version string, they're sometimes spurious. Not used anymore." ^[:package | package categories anySatisfy: [:cat | (cat name, '*') match: (Smalltalk version copyWithout: $ ) ]]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filters ^filters! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/24/2006 13:49'! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description. " | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^ self]. descriptions := self packageList collect: [:e | e description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 18:36'! hasSelectedItem ^ self selectedPackageOrRelease notNil! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by versions: (installed -> latest). If there is no arrow, your installed version of the package is the latest. Bold packages and releases have been installed. The checkbox menu items modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. Comment on a package by emailing the author or the squeak list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://wiki.squeak.org/2726' asUrl]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! informException: ex msg: msg "Tell the user that an error has occurred. Offer to open debug notifier." (self confirm: msg, 'Would you like to open a debugger?') ifTrue: [ex pass]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 05:28'! initialExtent ^500@400! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:53'! installPackageRelease: aRelease "Install a package release. The cache is used." | myRelease installer | aRelease isCompatibleWithCurrentSystemVersion ifFalse: [(self confirm: 'The package you are about to install is not listed as being compatible with your image version (', SystemVersion current majorMinorVersion, '), so the package may not work properly. Do you still want to proceed with the install?') ifFalse: [^ self]]. myRelease := self installedReleaseOfMe. installer := SMInstaller forPackageRelease: aRelease. [UIManager default informUser: 'Downloading ' , aRelease asString during: [installer download]. UIManager default informUser: 'Installing ' , aRelease asString during: [ installer install. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! installedReleaseOfMe "Return the release of the installed package loader." ^SMSqueakMap default installedReleaseOf: (SMSqueakMap default packageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3').! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! itemChildren: anItem ^ anItem isPackage ifTrue: [anItem releases] ifFalse: [#()]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 19:56'! itemDescription ^ self selectedPackageOrRelease ifNil: ['<No package selected>'] ifNotNilDo: [:item | item fullDescription]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! itemHasChildren: anItem ^ anItem isPackage and: [anItem releases notEmpty]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! itemLabel: anItem | label | label := anItem isPackage ifTrue: [anItem name , (anItem versionLabel ifEmpty: [''] ifNotEmptyDo: [:lbl | ' (' , anItem versionLabel , ')'])] ifFalse: [anItem smartVersion]. ^ anItem isInstalled ifTrue: [label asText allBold] ifFalse: [label]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/24/2006 17:17'! label ^ self labelForShown: (packagesList ifNil: [self packageList])! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! labelForFilter: aFilterSymbol ^(self filterSpecs detect: [:fs | fs second = aFilterSymbol]) first! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! labelForShown: packagesShown "Update the label of the window." ^ self defaultLabel , ' (', (packagesShown size < map packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , map packages size printString, ' packages)'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! listInPasteBuffer "Useful when talking with people etc. Uses the map to produce a nice String." Clipboard clipboardText: (String streamContents: [:s | packagesList do: [:p | s nextPutAll: p nameWithVersionLabel; cr ]]) asText! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:31'! loadUpdates [UIManager default informUser: 'Loading Updates' during: [ map loadUpdates. self noteChanged ] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when updating map:\', ex messageText, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/24/2006 14:05'! noteChanged filters ifNil: [^ self reOpen]. map ifNotNil: [packagesList := nil. selectedCategory := nil. self changed: #categoryList. self changed: #packageList. self changed: #packagesListIndex. "update my selection" self contentsChanged]! ! !SMLoaderPlus methodsFor: 'initialization' stamp: 'btr 11/22/2006 16:11'! on: aSqueakMap "Initialize instance." map := aSqueakMap. map synchWithDisk. filters := DefaultFilters copy. categoriesToFilterIds := DefaultCategoriesToFilterIds copy. self askToLoadUpdates! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! package: aPackage filteredByCategory: aCategory "Answer true if the package should be shown if we filter on <aCategory>. It should be shown if itself or any of its releases has the category." | releases | releases := aPackage releases. ^(aPackage hasCategoryOrSubCategoryOf: aCategory) or: [ releases anySatisfy: [:rel | rel hasCategoryOrSubCategoryOf: aCategory]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list | list := packagesList ifNil: [packagesList := self packageListCalculated]. selectedCategory ifNotNil: [ list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^ list! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageListCalculated "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." ^ self packages select: [:p | filters allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [self package: p filteredByCategory: (map object: currFilter)]]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! packageNameList ^ self packageList collect: [:e | e name]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:30'! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: (self commandSpecFor: #installPackageRelease)]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: (self commandSpecFor: #browseCacheDirectory)]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: (self commandSpecFor: #cachePackageReleaseAndOfferToCopy). choices add: (self commandSpecFor: #downloadPackageRelease)]. choices add: (self commandSpecFor: #emailPackageMaintainers). ^ choices! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 16:11'! packages "We request the packages as sorted by name by default." ^map packagesByName asArray ! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex ^ self packageList indexOf: self selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex: anObject self selectedItem: (anObject = 0 ifFalse: [self packageList at: anObject])! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! packagesMenu: aMenu "Answer the packages-list menu." self selectedPackageOrRelease ifNotNil: [aMenu addList: self packageSpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:45'! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." ^ (self respondsTo: selector) ifTrue: [self perform: selector] ifFalse: [super perform: selector orSendTo: otherTarget]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/26/2006 23:22'! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. window delete. (Smalltalk at: self class name) open! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeCategoryFilters "Remove all category filters." categoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeSelectedCategoryAsFilter "Remove the filter that filters on the currently selected category." categoriesToFilterIds remove: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! saveFiltersAsDefault "Save the current filters as default so that they are selected the next time the loader is opened." DefaultFilters := filters copy. DefaultCategoriesToFilterIds := categoriesToFilterIds copy! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchSelection "Selects all of the default search text so that a type-in overwrites it." ^ {1. self searchText size}! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchText "A dummy default search text so that the field describes its purpose." ^ 'Search packages'! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedCategory "Return selected category." ^ selectedCategory! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:37'! selectedCategory: anSMCategory "Change the selected category." selectedCategory := anSMCategory. selectedCategory ifNotNil: [(selectedCategory objects includes: self selectedItem) ifFalse: [self selectedItem: nil]]. self changed: #selectedCategory. self changed: #packageList! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:52'! selectedCategoryPath "Return selected category's path." | path | path := #(). selectedCategory ifNotNil: [selectedCategory parent ifNotNilDo: [:p | path := path copyWith: p]. path := path copyWith: selectedCategory]. ^ path collect: [:cat | self categoryLabel: cat]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedItem ^ selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:27'! selectedItem: anItem "This == workaround protects us from recursion since ToolBuilder's tree widgets will always tell us that the selection has been updated when we tell it that the selection path has been updated. Cleaner solutions invited." anItem == selectedItem ifFalse: [ selectedItem := anItem. self changed: #selectedItemPath. self changed: #itemDescription. self changed: #hasSelectedItem]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:16'! selectedItemPath | path | path := #(). (selectedItem isKindOf: SMPackageRelease) ifTrue: [path := path copyWith: selectedItem package]. selectedItem ifNotNil: [path := path copyWith: selectedItem]. ^ path! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:03'! selectedPackageOrRelease "Return selected package or package release." ^ selectedItem! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! showFilterString: aFilterSymbol ^(self stateForFilter: aFilterSymbol), (self labelForFilter: aFilterSymbol)! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! stateForFilter: aFilterSymbol ^(self filters includes: aFilterSymbol) ifTrue: ['<yes>'] ifFalse: ['<no>'] ! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! toggleFilterState: aFilterSymbol ^(self filters includes: (aFilterSymbol)) ifTrue: [self filterRemove: aFilterSymbol] ifFalse: [self filterAdd: aFilterSymbol]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! uncheckFilters "Uncheck all filters." filters := OrderedCollection new. self noteChanged! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! updateLabel: packagesShown "Update the label of the window." window ifNotNilDo: [:w | w setLabel: (self labelForShown: packagesShown)]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [ map upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. Confirms on each upgrade." ^ self upgradeInstalledPackagesConfirm: true! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade. " | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [^ self inform: 'All ' , installed size printString , ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [^ self inform: 'None of the ' , old size printString , ' old packages of the ' , installed size printString , ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: ['Of the ' , old size printString , ' old packages only ' , toUpgrade size printString , ' can be upgraded. The following packages will not be upgraded: ' , (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info , ' About to upgrade the following packages: ' , (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]) , 'Proceed?') ifTrue: [myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [confirmEach ifTrue: [map upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ' , p installedRelease packageNameWithVersion , ' to ' , (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName , '?']] ifFalse: [map upgradeOldPackages]. self inform: toUpgrade size printString , ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifTrue: [self noteChanged] ifFalse: [self reOpen]]] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\' , ex messageText , '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesNoConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. No confirmation on each upgrade." ^ self upgradeInstalledPackagesConfirm: false! ! !SMPackageWrapper methodsFor: 'comparing' stamp: 'dvf 9/21/2003 16:25' prior: 27998626! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMPackageWrapper methodsFor: 'converting' stamp: 'btr 11/22/2006 00:54' prior: 27998778! asString | string | string := item name, ' (', item versionLabel, ')'. item isInstalled ifTrue: [string := string asText allBold]. "(string includesSubString: '->') ifTrue: [string := string asText color: Color green]." ^ string! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'dvf 10/14/2003 18:58' prior: 27998902! contents ^item releases reversed collect: [:e | SMPackageReleaseWrapper with: e]! ! !SMPackageWrapper methodsFor: 'testing' stamp: 'dvf 9/21/2003 16:25' prior: 27999070! hash ^self withoutListWrapper hash! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:55'! help ^ 'This shows all packages with their releases that should be displayed according the current filter.'! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString! ! !SMPackageWrapper methodsFor: 'printing' stamp: 'dvf 9/21/2003 16:22' prior: 27999192! printOn: aStream aStream nextPutAll: 'wrapper for: ', item printString! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849043! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMCategoryWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 18:53' prior: 27849195! asString ^ item name , ' (' , self numberOfObjects printString , ')'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'ar 2/9/2004 02:35' prior: 27849301! category ^item! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 21:02' prior: 27849402! contents ^ item subCategories collect: [:n | self class with: n model: n]! ! !SMCategoryWrapper methodsFor: 'model access' stamp: 'btr 11/30/2006 21:02'! getList ^ Array with: (self class with: self contents model: model)! ! !SMCategoryWrapper methodsFor: 'testing' stamp: 'btr 11/30/2006 18:53'! hasContents ^ item hasSubCategories! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849700! hash ^self withoutListWrapper hash! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:56'! help ^ 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'BJP 11/22/2002 14:17'! model ^model! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:53'! numberOfObjects " | total | total _ 0. model allCategoriesDo: [:c | total _ total + c objects size]. ^total" ^item objects size! ! !SMPackageReleaseWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 21:30' prior: 27997393! asString "Show installed releases with a trailing asterisk." | string | string := item smartVersion. "Older SMBase versions don't have isInstalled.'" (item respondsTo: #isInstalled) ifTrue: [item isInstalled ifTrue: [string := (string , ' *') asText allBold]]. ^ string! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 17:14'! contents ^ #()! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString ! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47' prior: 27944626! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifAbsent: [self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white ifTrue: ["not set" Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor)]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52' prior: 27945298! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:08' prior: 54331069! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:15' prior: 27927912! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. item ifNil: [^nil]. dir := item isPackage ifTrue: [model cache directoryForPackage: item] ifFalse: [model cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. " withLabel: item name, ' cache directory'." win openInWorld ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:52'! buildButtonBar | aRow btn | aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. self buttonSpecs do: [:spec | btn := self buildButtonNamed: spec first helpText: spec third action: spec second. aRow addMorphBack: btn] separatedBy: [aRow addTransparentSpacerOfSize: 3@0]. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:27'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 19:04' prior: 27928394! buildMorphicCategoriesList "Create the hierarchical list holding the category tree." | list | list := (SimpleHierarchicalListMorph on: self list: #categoryWrapperList selected: #selectedCategoryWrapper changeSelected: #selectedCategoryWrapper: menu: #categoriesMenu: keystroke: nil) autoDeselect: true; enableDrag: false; enableDrop: true; yourself. list setBalloonText: 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'. "list scroller submorphs do:[:each| list expandAll: each]." list adjustSubmorphPositions. ^ list! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:22' prior: 27929139! buildMorphicPackagesList "Create the hierarchical list holding the packages and releases." ^(SimpleHierarchicalListMorph on: self list: #packageWrapperList selected: #selectedItemWrapper changeSelected: #selectedItemWrapper: menu: #packagesMenu: keystroke: nil) autoDeselect: false; enableDrag: false; enableDrop: true; setBalloonText: 'This shows all packages with their releases that should be displayed according the current filter.'; yourself! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:13'! buildPackageButtonBar | aRow | "Somewhat patterned after IRCe's buttonRow method." aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'gk 5/5/2006 02:05' prior: 27929686! buildPackagePane "Create the text area to the right in the loader." | ptm | ptm := PluggableTextMorph on: self text: #contents accept: nil readSelection: nil "#packageSelection " menu: nil. ptm setBalloonText: 'This is where the selected package or package release is displayed.'. ptm lock. ^ptm! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:08' prior: 27930070! buildSearchPane "Cribbed from MessageNames>>inMorphicWindowWithInitialSearchString:" | typeInView searchButton typeInPane | typeInView := PluggableTextMorph on: self text: nil accept: #findPackage:notifying: readSelection: nil menu: nil. typeInView acceptOnCR: true; vResizing: #spaceFill; hResizing: #spaceFill; setTextMorphToSelectAllOnMouseEnter; askBeforeDiscardingEdits: false; setProperty: #alwaysAccept toValue: true. (typeInView respondsTo: #hideScrollBarsIndefinitely) ifTrue: [typeInView hideScrollBarsIndefinitely] ifFalse: [typeInView hideScrollBarIndefinitely]. searchButton := SimpleButtonMorph new target: typeInView; color: Color white; label: 'Search'; actionSelector: #accept; arguments: #(); yourself. typeInPane := AlignmentMorph newRow. typeInPane vResizing: #shrinkWrap; hResizing: #shrinkWrap; listDirection: #leftToRight; addMorphFront: searchButton; addTransparentSpacerOfSize: 6 @ 0; addMorphBack: typeInView; setBalloonText: 'Type into the pane, then press Search (or hit RETURN) to visit the next package matching what you typed.'. ^ typeInPane! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:24'! buttonSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.') ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.') ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.') ('Update' loadUpdates 'Update the package index from the servers.') ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (confirming each).') ('Help' help 'What is this?'))! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:11' prior: 27936393! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoader methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01' prior: 27933585! categoryWrapperList "Create the wrapper list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (model categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list collect: [:cat | SMCategoryWrapper with: cat model: self]! ! !SMLoader methodsFor: 'filter utilities' stamp: 'gk 7/10/2004 15:45' prior: 27913226! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 17:30' prior: 27930584! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.3. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0.0 @ 0.0 corner: 1.0 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0.0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (0.0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0.0 @ horizDivide corner: vertDivide @ 1.0). self addMorph: (self buildPackagePane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1.0 @ 1.0). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self! ! !SMLoader methodsFor: 'interface' stamp: 'gk 7/12/2004 11:14' prior: 27931214! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:01'! defaultLabel ^'SqueakMap Package Loader'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:14' prior: 27917579! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoader methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 00:14' prior: 27923782! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #( #('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.')) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ', (model object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 19:27' prior: 27918212! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description." | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^self]. descriptions := self packageWrapperList collect: [:e | e withoutListWrapper description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:05' prior: 27937041! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:48' prior: 27931447! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by (installed version -> latest version). If there is no arrow, your installed version of the package is the latest. Installed packages and releases are also in bold. The checkbox menu items at the bottom let you modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. If you like a package or have comments on it, please contact the author or the squeak mailing list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://minnow.cc.gatech.edu/squeak/2726' asUrl]! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:13' prior: 27918874! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoader methodsFor: 'actions' stamp: 'mist 8/17/2005 13:56'! installPackageWithDependents: package | myRelease | myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ package installWithDependencies. myRelease = self installedReleaseOfMe ifFalse: [self reOpen]. self noteChanged] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoader methodsFor: 'initialization' stamp: 'gk 4/5/2005 21:17' prior: 27932588! openAsMorph "Open the loader as a Morphic window." "SMLoader new openAsMorph" ^self createWindow openInWorld! ! !SMLoader methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45' prior: 27934165! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list selectedCategory | list := packagesList ifNil: [ packagesList := self packages select: [:p | (filters ifNil: [#()]) allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [ self package: p filteredByCategory: (model object: currFilter)]]]]. selectedCategoryWrapper ifNotNil: [selectedCategory := selectedCategoryWrapper category. list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^list! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/22/2006 14:30' prior: 27937451! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: self buttonSpecs first]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: self buttonSpecs third]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: #('Copy from cache' #cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' ). choices add: #('Force download into cache' #downloadPackageRelease 'Force a download of the selected release into the cache.' )]. choices add: self buttonSpecs second. ^ choices! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:56' prior: 27913703! packagesListIndex: anObject self selectedItemWrapper: (anObject ifNotNil: [anObject = 0 ifFalse: [self packageWrapperList at: anObject]])! ! !SMLoader methodsFor: 'interface' stamp: 'gk 4/5/2005 21:43' prior: 27932888! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." (self respondsTo: selector) ifTrue: [^ self perform: selector] ifFalse: [^ super perform: selector orSendTo: otherTarget]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/26/2006 23:22' prior: 27941030! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. self delete. (Smalltalk at: self class name) open! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 19:17' prior: 27913904! selectedCategory "Return selected category." ^selectedCategoryWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 12/1/2006 15:51' prior: 27914233! selectedCategoryWrapper: aWrapper selectedCategoryWrapper := aWrapper. (aWrapper notNil and: [aWrapper withoutListWrapper objects includes: selectedItemWrapper withoutListWrapper]) ifFalse: [self selectedItemWrapper: nil]. self changed: #selectedCategoryWrapper. self changed: #packageWrapperList.! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/22/2006 19:13' prior: 27914590! selectedItemWrapper: aWrapper selectedItemWrapper := aWrapper. self changed: #selectedItemWrapper. self contentsChanged! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:10' prior: 27941340! selectedPackageOrRelease "Return selected package or package release." ^self selectedItemWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:02' prior: 27935346! updateLabel: packagesShown "Update the label of the window." self setLabel: self defaultLabel , ' (', (packagesShown size < model packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , model packages size printString, ' packages)'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 21:03' prior: 27921197! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ model upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:03' prior: 27941568! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ confirmEach ifTrue: [ model upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ', p installedRelease packageNameWithVersion, ' to ', (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName, '?']] ifFalse: [model upgradeOldPackages]. self inform: toUpgrade size printString, ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifAbsent: [ (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #installedPackageNameList selected: #installedPackagesListIndex changeSelected: #installedPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicNotInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #notInstalledPackageNameList selected: #notInstalledPackagesListIndex changeSelected: #notInstalledPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createFancyWindow "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicNotInstalledPackagesList borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (horizDivide / 2)). self addMorph: (self buildMorphicInstalledPackagesList borderWidth: 0) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setUpdatablePanesFrom: #(#installedPackageNameList #notInstalledPackageNameList ). currentPackageList := #notInstalled. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide). self addMorph: (self buildSearchPane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 17:27'! currentPackageList ^currentPackageList! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'btr 11/30/2006 17:44'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! defaultLabel ^ 'SqueakMap Categorical Package Loader'! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! installedPackageNameList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! installedPackagesListIndex self currentPackageList = #installed ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 15:09'! isOn ^false! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! notInstalledPackageNameList ^self packageList select: [:e | e isInstalled not]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! notInstalledPackagesListIndex self currentPackageList = #notInstalled ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategorical methodsFor: 'private' stamp: 'btr 11/30/2006 20:21'! noteChanged self changed: #installedPackageNameList. self changed: #notInstalledPackageNameList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! SMLoader removeSelector: #paneColorOld! SMLoader removeSelector: #addPackagesTo:at:plus:! "SMLoader"! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! ----STARTUP----{19 April 2010 . 12:31:46 am} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! Smalltalk removeClassNamed: #MCMockClassC! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 59339410! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066043! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066175! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 57066304! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066431! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066565! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066689! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066783! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066859! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066935! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 57067021! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 57067115! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 57067217! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 57067420! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 57067488! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 57067587! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 23101866! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 57068777! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 57068888! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 59339563! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 57067679! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33645350! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645710! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645842! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33645971! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646098! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33646232! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646356! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646450! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646526! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646602! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33646688! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33646782! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33646884! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33647080! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33647148! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33647247! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33647351! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33647608! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33647869! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33648753! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33648927! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653416! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653555! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653766! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654029! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654165! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654418! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654514! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654737! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33654832! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655111! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655198! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33655388! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33656020! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656135! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33649269! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649629! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649761! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33649890! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650017! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33650151! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650275! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654610! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654309! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653921! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33650701! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33650803! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656527! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33650999! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33655542! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33656315! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33651270! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33651527! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33651788! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33652672! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33652846! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 57169526! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668453! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33668066! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668558! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33668861! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33668971! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669096! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33669221! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669331! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:32' prior: 24924985! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33669536! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669436! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669756! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669881! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669986! override ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33666466! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667021! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667137! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33667250! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667361! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667479! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667587! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667655! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667705! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667755! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33667815! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33667893! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33667979! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33668150! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33668192! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33668275! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33666736! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33666835! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33666930! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33666619! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33668351! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33670377! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670737! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670869! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33670998! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671125! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33671259! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671383! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671477! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671553! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671629! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33671715! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33671809! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33671911! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33672107! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33672175! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33672274! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33672378! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33672635! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33672896! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33673780! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33673954! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! Smalltalk removeClassNamed: #MCMockClassC! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678598! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678737! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33678948! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679211! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679347! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679600! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679696! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679919! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33680014! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680293! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680380! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33680570! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33681202! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681317! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33674296! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674656! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674788! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33674917! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675044! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33675178! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675302! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679792! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679491! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33679103! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33675728! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33675830! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681709! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33676026! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33680724! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33681497! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33676297! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33676554! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33676815! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33677699! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33677873! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33670091! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693635! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33693248! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693740! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694043! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694153! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694278! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694403! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694513! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:33' prior: 33669632! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33694718! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694618! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694938! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695063! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695168! override ^ 1! ! ----STARTUP----{29 April 2010 . 11:05:03 am} as /Users/bert/Downloads/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{29 April 2010 . 11:05:16 am} Squeak4.1.image priorSource: 229! ----STARTUP----{27 April 2011 . 11:47:16 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----SNAPSHOT----{27 April 2011 . 6:01:18 pm} Pacman.image priorSource: 229! ----QUIT----{27 April 2011 . 6:01:51 pm} Pacman.image priorSource: 141204! ----STARTUP----{27 April 2011 . 6:04:35 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Field instanceVariableNames:'' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Pacman instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! ----QUIT----{27 April 2011 . 7:38:58 pm} Squeak4.1.image priorSource: 141281! ----STARTUP----{27 April 2011 . 7:39:01 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT----{27 April 2011 . 8:19:22 pm} Squeak4.1.image priorSource: 142242! ----STARTUP----{28 April 2011 . 1:07:38 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields "Answer the value of fields" ^ fields! ! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields: anObject "Set the value of fields" fields := anObject! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:19'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:19'! setUpMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:27' prior: 33697668! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:27'! initializeMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:29' prior: 33698196! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:29'! fdf ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! PacmanServiceProvider removeSelector: #setUpMap! PacmanServiceProvider removeSelector: #initializeMap! PacmanServiceProvider removeSelector: #fdf! Smalltalk removeClassNamed: #PacmanServiceProvider! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:44'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:44'! initMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! Smalltalk removeClassNamed: #PacmanServiceProvider! !Map methodsFor: 'nil' stamp: 'abc 4/28/2011 13:59'! initMap self inform: 'Hello, World!!'. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 14:01' prior: 33699968! initMap self inform: 'Hello, World!!'.! ! Object subclass: #Map instanceVariableNames: 'fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:32' prior: 33700098! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:43' prior: 33700358! initMap self inform: 'Hello, World!!'. n := 50. m := 100. ^self.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:45' prior: 33700506! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! ----QUIT----{28 April 2011 . 11:54:29 pm} Squeak4.1.image priorSource: 142450! ----STARTUP----{29 April 2011 . 7:49:40 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 19:56' prior: 33700662! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:01'! initialize super initialize. self initMap.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:05' prior: 33701019! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:24'! main | m | m := Map new.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:25' prior: 33701337! initMap n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 4/29/2011 20:25' prior: 33701523! main | m | m := Map new. self inform: 'Hello, World!!'.! ! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! ----QUIT----{30 April 2011 . 12:40:44 am} Squeak4.1.image priorSource: 146293! ----STARTUP----{10 May 2011 . 11:55:01 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 11:56' prior: 33701823! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! main! main! ----SNAPSHOT----{10 May 2011 . 12:48:51 pm} Squeak4.1.image priorSource: 147520! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! main! main! self inform: 'Hello, World!!'.! ----QUIT/NOSAVE----{10 May 2011 . 12:50:26 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{10 May 2011 . 12:50:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! self inform: 'Hello, World!!'.! | m |! main! main! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 12:58' prior: 33702246! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:17' prior: 33702889! main | m | m := Map new. self inform: 'Hello, World!!'.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:18' prior: 33703043! main | m | m := Map new. self inform: 'Hello, World!!'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:20' prior: 33703190! main | m | m := Map new. self inform: 'Hello, World!!'. self inform: 'sthg other'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703368! main | m | m := Map new. self inform: 'done'. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703574! main | m | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703712! main | m form | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703886! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:25' prior: 33704067! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 10@10. self inform: 'done'. ! ! | m | m := Map new. m main. ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:26' prior: 33704296! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704580! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704833! main | m form | m := Map new. m initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! Morph subclass: #Game instanceVariableNames: 'form' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Morph subclass: #Game instanceVariableNames: 'form map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Game methodsFor: 'nil' stamp: 'abc 5/10/2011 14:34'! main "starting point of application" | temporary variable names | ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:35' prior: 33705581! main "starting point of application" map := Map new. map initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! Map removeSelector: #main! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:36' prior: 33705741! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:55' prior: 33706070! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'myGraphicsFileName') displayAt: 50@50. "self inform: 'done'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:57' prior: 33706372! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33706695! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33707040! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707387! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: '/home/michael/Desktop/guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707736! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708146! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708495! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "(Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:01' prior: 33708842! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:31' prior: 33709396! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:32' prior: 33709907! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! ----QUIT----{10 May 2011 . 9:33:43 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{11 May 2011 . 10:09:17 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'template fields x y' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:16' prior: 33701637! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711207! initMap "setting up the grid" x := 35. y := 17. "setting up template" "template = Array new: y. fields := Array new: y." fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711463! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'accessing' stamp: 'abc 5/11/2011 10:19' prior: 33697512! fields: anObject "Set the value of fields" fields := anObject! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33710291! main "starting point of application" "map := Map new. map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33712121! main "starting point of application" map := Map new. "map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:22' prior: 33711721! initMap "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:22' prior: 33712511! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33701205! initialize super initialize. self initMap. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33713503! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! Map removeSelector: #initMap! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:38' prior: 33713797! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33713117! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50 asMorph. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33715475! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." ((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33714148! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | Transcript show: j@i. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33716267! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | Transcript show: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:16' prior: 33717765! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | self inform: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:17' prior: 33719222! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33720675! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33722185! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33723763! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 50@50) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33725345! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:44' prior: 33727030! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:57' prior: 33728758! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:11' prior: 33730486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | template at: j - 1 at: i = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" (i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]. "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:12' prior: 33732822! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | ((template at: j - 1) at: i) = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:32' prior: 33735412! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType += 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType += 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:33' prior: 33738008! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType = blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType = blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:34' prior: 33740641! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:37' prior: 33743295! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((x-1)*16)@((y-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:38' prior: 33745992! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:40' prior: 33748777! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 13:40' prior: 33715830! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." "((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33751644! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33754790! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33757779! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:47' prior: 33760769! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:48' prior: 33763801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j <= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:49' prior: 33766833! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:51' prior: 33769999! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 14:01' prior: 33773247! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33776454! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33779649! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33782846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33786083! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:44' prior: 33789318! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:45' prior: 33792555! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:48' prior: 33795706! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= '#' ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:50' prior: 33798859! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:58' prior: 33801932! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank') asMorph. ]. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:00' prior: 33805001! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:01' prior: 33808109! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:03' prior: 33811262! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/black.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:16' prior: 33814460! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! ----QUIT----{12 May 2011 . 12:42:34 am} Squeak4.1.image priorSource: 156201! ----STARTUP----{15 May 2011 . 12:07:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:16' prior: 33817617! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:18' prior: 33821056! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33824352! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" "((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33827752! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33831225! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 50@300) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:33' prior: 33834737! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 0@0) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:43' prior: 33838211! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'nil' stamp: 'abc 5/15/2011 13:15'! renderPlayer: player x: x y: y "render player at a given coordinate"! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 13:22' prior: 33845368! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4.! ! Object subclass: #Map instanceVariableNames: 'template fields x y players' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:27' prior: 33841928! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33845919! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33849381! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:35' prior: 33852872! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:36' prior: 33856361! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:37' prior: 33859848! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33863337! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i) put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33866825! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:22' prior: 33870315! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33873803! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. pics at: 17 put: ''. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33877292! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:31' prior: 33880801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:34' prior: 33884288! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! Object subclass: #Map instanceVariableNames: 'template fields x y players points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:37' prior: 33887775! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:39' prior: 33891470! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:41' prior: 33895119! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:42' prior: 33898834! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:43' prior: 33902579! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:46' prior: 33845567! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player show.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:48' prior: 33910119! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player openeWorld.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:50' prior: 33910377! renderPlayer: player x: x y: y "render player at a given coordinate" player drawOn: ((x-1)*16)+4@((y-1)*16)+4. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:52' prior: 33910600! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33910804! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33911075! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:54' prior: 33906285! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:55' prior: 33911565! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33915486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33919666! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:58'! redrawField: position "redraq part of the map" | temporary variable names | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:08' prior: 33928011! redrawField: position "redraw part of the map" ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928180! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928361! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:12' prior: 33923846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: (35, 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:13' prior: 33928805! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:14' prior: 33928554! redrawField: position "redraw part of the map" ((fields at: (position at: 2)) at: (position at: 1)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33932972! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. "self redrawField: #(35 1)." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33937391! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:18' prior: 33937140! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:19' prior: 33945810! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). field imageForm display. (fields at: y) at: x put: field.! ! game := Game new.! | game | game := Game new. game main. ! Smalltalk removeClassNamed: #Wall! Smalltalk removeClassNamed: #EmptyField! Smalltalk removeClassNamed: #Field! | game | game := Game new. game main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/15/2011 18:13'! template "getter for template" ^template.! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 18:14' prior: 33754392! main "starting point of application" map := Map new. map initialize.! ! Smalltalk removeClassNamed: #Pacman! | game | game := Game new. game main. ! \ No newline at end of file | 'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 17 April 2010 at 5:22:05 pm'! ----STARTUP----{17 April 2010 . 5:21:54 pm} as C:\Squeak\4.0\4.1-final\Squeak4.1.image! Smalltalk appendChangesTo: 'SqueakV41.sources'.! ----QUIT----{17 April 2010 . 5:22:11 pm} Squeak4.1.image priorSource: 89! ----STARTUP----{18 April 2010 . 5:57:27 pm} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! !BlockContextTest methodsFor: 'running' stamp: 'md 9/6/2005 19:56' prior: 50431957! setUp super setUp. aBlockContext := [100@100 corner: 200@200]. contextOfaBlockContext := thisContext.! ! !BehaviorTest methodsFor: 'tests' stamp: 'md 2/18/2006 16:42' prior: 17365994! testBinding self assert: Object binding value = Object. self assert: Object binding key = #Object. self assert: Object class binding value = Object class. "returns nil for Metaclasses... like Encoder>>#associationFor:" self assert: Object class binding key = nil.! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53956757! testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #EmbeddedSourceQCompress ). self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer sourceCode: code. self assert: (trailer kind == #EmbeddedSourceZip ). newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53957691! testEmbeddingTempNames | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer tempNames: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #TempsNamesQCompress ). self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer tempNames: code. self assert: (trailer kind == #TempsNamesZip ). newTrailer := trailer testEncoding. self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:17' prior: 53958613! testEncodingNoTrailer | trailer | trailer := CompiledMethodTrailer new. "by default it should be a no-trailer" self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:14' prior: 53959109! testEncodingSourcePointer | trailer | trailer := CompiledMethodTrailer new. CompiledMethod allInstancesDo: [:method | | ptr | trailer method: method. self assert: ( (ptr := method sourcePointer) == trailer sourcePointer). "the last bytecode index must be at 0" ptr ~= 0 ifTrue: [ self assert: (method endPC = trailer endPC) ]. ].! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53959564! testEncodingVarLengthSourcePointer | trailer newTrailer | trailer := CompiledMethodTrailer new. trailer sourcePointer: 1. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 1). trailer sourcePointer: 16r100000000000000. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 16r100000000000000). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53960108! testSourceByIdentifierEncoding | trailer id | trailer := CompiledMethodTrailer new. id := UUID new asString. trailer sourceIdentifier: id. self assert: (trailer kind == #SourceByStringIdentifier ). trailer := trailer testEncoding. self assert: (trailer kind == #SourceByStringIdentifier ). self assert: (trailer sourceIdentifier = id). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:49' prior: 53960643! testSourceBySelectorEncoding | trailer | trailer := CompiledMethodTrailer new. trailer setSourceBySelector. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CategorizerTest methodsFor: 'running' stamp: 'mtf 9/10/2007 10:10' prior: 18074036! setUp categorizer := Categorizer defaultList: #(a b c d e). categorizer classifyAll: #(a b c) under: 'abc'. categorizer addCategory: 'unreal'.! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074267! testClassifyNewElementNewCategory categorizer classify: #f under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') (''nice'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:18' prior: 18074541! testClassifyNewElementOldCategory categorizer classify: #f under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074806! testClassifyOldElementNewCategory categorizer classify: #e under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'') (''nice'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:54' prior: 18075078! testClassifyOldElementOldCategory categorizer classify: #e under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:22' prior: 18075341! testDefaultCategoryIsTransient "Test that category 'as yet unclassified' disapears when all it's elements are removed'" categorizer classifyAll: #(d e) under: #abc. self assert: categorizer printString = '(''abc'' a b c d e) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 15:15' prior: 18075669! testNullCategory "Test that category 'as yet unclassified' disapears when all it's elements are removed'" | aCategorizer | aCategorizer := Categorizer defaultList: #(). self assert: aCategorizer printString = '(''as yet unclassified'') '. self assert: aCategorizer categories = #('no messages'). aCategorizer classify: #a under: #b. self assert: aCategorizer printString = '(''b'' a) '. self assert: aCategorizer categories = #(b).! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18076194! testRemoveEmptyCategory categorizer removeCategory: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:55' prior: 18076430! testRemoveExistingElement categorizer removeElement: #a. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076673! testRemoveNonEmptyCategory self should: [categorizer removeCategory: #abc] raise: Error. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076950! testRemoveNonExistingCategory categorizer removeCategory: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18077203! testRemoveNonExistingElement categorizer removeElement: #f. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 14:49' prior: 18077451! testRemoveThenRename categorizer removeCategory: #unreal. categorizer renameCategory: #abc toBe: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''unreal'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:14' prior: 18077736! testUnchanged self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! "KernelTests"! !SMLoaderPlus commentStamp: 'btr 12/1/2006 15:16' prior: 0! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). It uses ToolBuilder to construct its window. You can open one with: SMLoaderPlus open Instance Variables categoriesToFilterIds: <OrderedCollection> The set of categories to filter the packages list. filters: <OrderedCollection> The set of filters to apply to the packages list. map: <SMSqueakMap> The model SqueakMap. packagesList: <OrderedCollection> The list of packages from the map. selectedCategory: <SMCategory> The current category. selectedItem: <SMPackage> The selected package or release. window: <PluggableSystemWindow> The window, held only so we can reOpen.! !SMLoaderCategoricalPlus commentStamp: 'btr 12/4/2006 15:47' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategoricalPlus open! !SMLoader commentStamp: 'btr 11/30/2006 18:00' prior: 27913009! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). You can open one with: SMLoader open! !SMLoaderCategorical commentStamp: 'btr 12/1/2006 15:16' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategorical open! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifPresent: [:tb | (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:50'! buildFancyWith: aBuilder "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)); yourself); add: ((self buildNotInstalledPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ (horizDivide / 2)); yourself); add: ((self buildInstalledPackagesListWith: builder) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide); yourself); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1); yourself); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. self setUpdatablePanesFrom: #(#installedPackageList #notInstalledPackageList ). currentPackageList := #notInstalled. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:56'! buildInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #installedPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:52'! buildNotInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #notInstalledPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:55'! buildWith: aBuilder | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight))); add: ((self buildPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide)); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1)); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList ^currentPackageList! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:55'! defaultLabel ^ 'Categorical ' , super defaultLabel! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:52'! installedPackageList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! installedPackagesListIndex ^ self currentPackageList = #installed ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! isOn ^false! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:53'! notInstalledPackageList ^self packageList reject: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! notInstalledPackagesListIndex ^ self currentPackageList = #notInstalled ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:03'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategoricalPlus methodsFor: 'private' stamp: 'btr 12/1/2006 17:53'! noteChanged self changed: #installedPackageList. self changed: #notInstalledPackageList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:34'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! !SMLoaderPlus class methodsFor: 'parts bin' stamp: 'btr 11/22/2006 15:02'! descriptionForPartsBin ^self partName: 'Package Loader' categories: #(Tools) documentation: 'SqueakMap UI' ! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47'! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifPresent: [:tb | self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white "not set" ifTrue: [ Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor) ]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! initializedInstance ^ (ToolBuilder open: self new) extent: 400@400! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! new "Create a SqueakMap loader on the default map." ^self newOn: SMSqueakMap default! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! newOn: aMap "Create a SqueakMap loader on given map." ^super new on: aMap; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! newStandAlone ^ ToolBuilder open: self new! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:13'! open "Create and open a SqueakMap Loader." "SMLoaderPlus open" ^ (Smalltalk at: #ToolBuilder) open: self new! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:21'! openOn: aSqueakMap "Create and open a SqueakMap Loader on a given map." "self openOn: SqueakMap default" ^ (Smalltalk at: #ToolBuilder) open: (self newOn: aSqueakMap)! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:18'! prototypicalToolWindow ^ ToolBuilder open: self new; applyModelExtent; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:02'! registerInFlapsRegistry "Register the receiver in the system's flaps registry." self environment at: #Flaps ifPresent: [:cl | (cl respondsTo: #registerQuad:forFlapNamed:) ifTrue: [cl registerQuad: #(#SMLoader #prototypicalToolWindow 'Package Loader' 'The SqueakMap Package Loader' ) forFlapNamed: 'Tools']]! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoaderPlus class methodsFor: 'window color' stamp: 'btr 11/22/2006 15:02'! windowColorSpecification "Answer a WindowColorSpec object that declares my preference." ^WindowColorSpec classSymbol: self name wording: 'Package Loader' brightColor: Color yellow muchLighter duller pastelColor: Color yellow veryMuchLighter duller helpMessage: 'The SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! addSelectedCategoryAsFilter "Add a new filter that filters on the currently selected category. Make it enabled as default." categoriesToFilterIds add: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 16:11'! askToLoadUpdates "Check how old the map is and ask to update it if it is older than 10 days or if there is no map on disk." | available | available := map isCheckpointAvailable. (available not or: [ (Date today subtractDate: (Date fromSeconds: (map directory directoryEntryFor: map lastCheckpointFilename) modificationTime)) > 3]) ifTrue: [ (self confirm: (available ifTrue: ['The map on disk is more than 10 days old, update it from the Internet?'] ifFalse: ['There is no map on disk, fetch it from the Internet?'])) ifTrue: [self loadUpdates]]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:43'! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. dir := item isPackage ifTrue: [map cache directoryForPackage: item] ifFalse: [map cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. "withLabel: item name, ' cache directory'." win openInWorld! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildButtonBarWith: aBuilder ^ aBuilder pluggablePanelSpec new model: self; layout: #horizontal; children: (self commandSpecs select: [ :spec | spec fourth includes: #all] thenCollect: [ :spec | aBuilder pluggableActionButtonSpec new model: self; label: spec first; action: spec second; help: spec third; enabled: ((spec fourth includes: #item) ifTrue: [#hasSelectedItem]); yourself]); name: #buttonBar; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildCategoriesListWith: aBuilder "Create the hierarchical list holding the category tree." ^ aBuilder pluggableTreeSpec new model: self; roots: #categoryList; getSelectedPath: #selectedCategoryPath; getChildren: #categoryChildren:; hasChildren: #categoryHasChildren:; setSelected: #selectedCategory:; menu: #categoriesMenu:; label: #categoryLabel:; autoDeselect: true; wantsDrop: true; name: #categoriesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagePaneWith: aBuilder "Create the text area to the right in the loader." ^ aBuilder pluggableTextSpec new model: self; getText: #itemDescription; name: #packagePane; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagesListWith: aBuilder "Create the hierarchical list holding the packages and releases." ^ aBuilder pluggableTreeSpec new model: self; roots: #packageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; name: #packagesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildSearchPaneWith: aBuilder ^ aBuilder pluggableInputFieldSpec new model: self; selection: #searchSelection; getText: #searchText; setText: #findPackage:notifying:; name: #search; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:54'! buildWith: aBuilder "Create the package loader window." | buttonBarHeight vertDivide horizDivide | buttonBarHeight := 0.07. vertDivide := 0.6. horizDivide := 0.3. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight)); add: ((self buildSearchPaneWith: builder) frame: (0 @ buttonBarHeight corner: horizDivide @ (buttonBarHeight * 2))); add: ((self buildPackagesListWith: builder) frame: (0 @ (buttonBarHeight * 2) corner: horizDivide @ vertDivide)); add: ((self buildCategoriesListWith: builder) frame: (0 @ vertDivide corner: horizDivide @ 1)); add: ((self buildPackagePaneWith: builder) frame: (horizDivide @ buttonBarHeight corner: 1 @ 1)); yourself); yourself). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! cachePackageReleaseAndOfferToCopy "Cache package release, then offer to copy it somewhere. Answer the chosen file's location after copy, or the cache location if no directory was chosen." | release installer newDir newName newFile oldFile oldName | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. installer := SMInstaller forPackageRelease: release. [UIManager default informUser: 'Caching ' , release asString during: [installer cache]] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs. ^nil ]. installer isCached ifFalse: [self inform: 'Download failed, see transcript for details'. ^nil]. oldName := installer fullFileName. newDir := FileList2 modalFolderSelector: installer directory. newDir ifNil: [ ^oldName ]. newDir = installer directory ifTrue: [ ^oldName ]. newName := newDir fullNameFor: installer fileName. newFile := FileStream newFileNamed: newName. newFile ifNil: [ ^oldName ]. newFile binary. oldFile := FileStream readOnlyFileNamed: oldName. oldFile ifNil: [ ^nil ]. oldFile binary. [[ newDir copyFile: oldFile toFile: newFile ] ensure: [ oldFile close. newFile close ]] on: Error do: [ :ex | ^oldName ]. ^newName! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categoriesMenu: aMenu "Answer the categories-list menu." self selectedCategory ifNotNil: [aMenu addList: self categorySpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! categoryChildren: aCategory ^ aCategory subCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! categoryHasChildren: aCategory ^ aCategory hasSubCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:46'! categoryLabel: aCategory ^ aCategory name! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01'! categoryList "Create the category list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (map categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/22/2006 15:02'! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:01'! commandSpecFor: selector ^ self commandSpecs detect: [:spec | spec second = selector]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:00'! commandSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.' (item all)) ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.' (item all)) ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.' (item all)) ('Copy from cache' cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' (item)) ('Force download into cache' downloadPackageRelease 'Force a download of the selected release into the cache.' (item)) ('Update' loadUpdates 'Update the package index from the servers.' (all)) ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (conf8irming each).' (all)) ('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm '' (item)) ('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm '' (item)) ('Copy list' listInPasteBuffer 'Puts the list as text into the clipboard.' (all)) ('Save filters' saveFiltersAsDefault 'Saves the current filters as default.' (all)) ('Help' help 'What is this?' (all)))! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! defaultLabel ^ 'SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! downloadPackageRelease "Force a download of the selected package release into the cache." | release | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. [UIManager default informUser: 'Downloading ' , release asString during: [ (SMInstaller forPackageRelease: release) download] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterAdd: anObject self changeFilters: (self filters copyWith: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterAutoInstall ^[:package | package isInstallable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterAvailable ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterInstalled ^[:package | package isInstalled]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterNotInstalledYet ^[:package | package isInstalled not]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterNotUptoDate ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterPublished ^[:package | package isPublished]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterRemove: anObject self changeFilters: (self filters copyWithout: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterSafelyAvailable ^[:package | package isSafelyAvailable]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/30/2006 21:07'! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #(#('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.') ) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ' , (map object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterVersion "Ignore spaces in the version string, they're sometimes spurious. Not used anymore." ^[:package | package categories anySatisfy: [:cat | (cat name, '*') match: (Smalltalk version copyWithout: $ ) ]]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filters ^filters! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/24/2006 13:49'! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description. " | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^ self]. descriptions := self packageList collect: [:e | e description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 18:36'! hasSelectedItem ^ self selectedPackageOrRelease notNil! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by versions: (installed -> latest). If there is no arrow, your installed version of the package is the latest. Bold packages and releases have been installed. The checkbox menu items modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. Comment on a package by emailing the author or the squeak list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://wiki.squeak.org/2726' asUrl]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! informException: ex msg: msg "Tell the user that an error has occurred. Offer to open debug notifier." (self confirm: msg, 'Would you like to open a debugger?') ifTrue: [ex pass]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 05:28'! initialExtent ^500@400! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:53'! installPackageRelease: aRelease "Install a package release. The cache is used." | myRelease installer | aRelease isCompatibleWithCurrentSystemVersion ifFalse: [(self confirm: 'The package you are about to install is not listed as being compatible with your image version (', SystemVersion current majorMinorVersion, '), so the package may not work properly. Do you still want to proceed with the install?') ifFalse: [^ self]]. myRelease := self installedReleaseOfMe. installer := SMInstaller forPackageRelease: aRelease. [UIManager default informUser: 'Downloading ' , aRelease asString during: [installer download]. UIManager default informUser: 'Installing ' , aRelease asString during: [ installer install. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! installedReleaseOfMe "Return the release of the installed package loader." ^SMSqueakMap default installedReleaseOf: (SMSqueakMap default packageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3').! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! itemChildren: anItem ^ anItem isPackage ifTrue: [anItem releases] ifFalse: [#()]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 19:56'! itemDescription ^ self selectedPackageOrRelease ifNil: ['<No package selected>'] ifNotNilDo: [:item | item fullDescription]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! itemHasChildren: anItem ^ anItem isPackage and: [anItem releases notEmpty]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! itemLabel: anItem | label | label := anItem isPackage ifTrue: [anItem name , (anItem versionLabel ifEmpty: [''] ifNotEmptyDo: [:lbl | ' (' , anItem versionLabel , ')'])] ifFalse: [anItem smartVersion]. ^ anItem isInstalled ifTrue: [label asText allBold] ifFalse: [label]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/24/2006 17:17'! label ^ self labelForShown: (packagesList ifNil: [self packageList])! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! labelForFilter: aFilterSymbol ^(self filterSpecs detect: [:fs | fs second = aFilterSymbol]) first! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! labelForShown: packagesShown "Update the label of the window." ^ self defaultLabel , ' (', (packagesShown size < map packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , map packages size printString, ' packages)'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! listInPasteBuffer "Useful when talking with people etc. Uses the map to produce a nice String." Clipboard clipboardText: (String streamContents: [:s | packagesList do: [:p | s nextPutAll: p nameWithVersionLabel; cr ]]) asText! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:31'! loadUpdates [UIManager default informUser: 'Loading Updates' during: [ map loadUpdates. self noteChanged ] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when updating map:\', ex messageText, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/24/2006 14:05'! noteChanged filters ifNil: [^ self reOpen]. map ifNotNil: [packagesList := nil. selectedCategory := nil. self changed: #categoryList. self changed: #packageList. self changed: #packagesListIndex. "update my selection" self contentsChanged]! ! !SMLoaderPlus methodsFor: 'initialization' stamp: 'btr 11/22/2006 16:11'! on: aSqueakMap "Initialize instance." map := aSqueakMap. map synchWithDisk. filters := DefaultFilters copy. categoriesToFilterIds := DefaultCategoriesToFilterIds copy. self askToLoadUpdates! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! package: aPackage filteredByCategory: aCategory "Answer true if the package should be shown if we filter on <aCategory>. It should be shown if itself or any of its releases has the category." | releases | releases := aPackage releases. ^(aPackage hasCategoryOrSubCategoryOf: aCategory) or: [ releases anySatisfy: [:rel | rel hasCategoryOrSubCategoryOf: aCategory]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list | list := packagesList ifNil: [packagesList := self packageListCalculated]. selectedCategory ifNotNil: [ list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^ list! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageListCalculated "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." ^ self packages select: [:p | filters allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [self package: p filteredByCategory: (map object: currFilter)]]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! packageNameList ^ self packageList collect: [:e | e name]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:30'! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: (self commandSpecFor: #installPackageRelease)]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: (self commandSpecFor: #browseCacheDirectory)]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: (self commandSpecFor: #cachePackageReleaseAndOfferToCopy). choices add: (self commandSpecFor: #downloadPackageRelease)]. choices add: (self commandSpecFor: #emailPackageMaintainers). ^ choices! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 16:11'! packages "We request the packages as sorted by name by default." ^map packagesByName asArray ! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex ^ self packageList indexOf: self selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex: anObject self selectedItem: (anObject = 0 ifFalse: [self packageList at: anObject])! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! packagesMenu: aMenu "Answer the packages-list menu." self selectedPackageOrRelease ifNotNil: [aMenu addList: self packageSpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:45'! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." ^ (self respondsTo: selector) ifTrue: [self perform: selector] ifFalse: [super perform: selector orSendTo: otherTarget]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/26/2006 23:22'! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. window delete. (Smalltalk at: self class name) open! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeCategoryFilters "Remove all category filters." categoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeSelectedCategoryAsFilter "Remove the filter that filters on the currently selected category." categoriesToFilterIds remove: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! saveFiltersAsDefault "Save the current filters as default so that they are selected the next time the loader is opened." DefaultFilters := filters copy. DefaultCategoriesToFilterIds := categoriesToFilterIds copy! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchSelection "Selects all of the default search text so that a type-in overwrites it." ^ {1. self searchText size}! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchText "A dummy default search text so that the field describes its purpose." ^ 'Search packages'! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedCategory "Return selected category." ^ selectedCategory! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:37'! selectedCategory: anSMCategory "Change the selected category." selectedCategory := anSMCategory. selectedCategory ifNotNil: [(selectedCategory objects includes: self selectedItem) ifFalse: [self selectedItem: nil]]. self changed: #selectedCategory. self changed: #packageList! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:52'! selectedCategoryPath "Return selected category's path." | path | path := #(). selectedCategory ifNotNil: [selectedCategory parent ifNotNilDo: [:p | path := path copyWith: p]. path := path copyWith: selectedCategory]. ^ path collect: [:cat | self categoryLabel: cat]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedItem ^ selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:27'! selectedItem: anItem "This == workaround protects us from recursion since ToolBuilder's tree widgets will always tell us that the selection has been updated when we tell it that the selection path has been updated. Cleaner solutions invited." anItem == selectedItem ifFalse: [ selectedItem := anItem. self changed: #selectedItemPath. self changed: #itemDescription. self changed: #hasSelectedItem]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:16'! selectedItemPath | path | path := #(). (selectedItem isKindOf: SMPackageRelease) ifTrue: [path := path copyWith: selectedItem package]. selectedItem ifNotNil: [path := path copyWith: selectedItem]. ^ path! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:03'! selectedPackageOrRelease "Return selected package or package release." ^ selectedItem! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! showFilterString: aFilterSymbol ^(self stateForFilter: aFilterSymbol), (self labelForFilter: aFilterSymbol)! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! stateForFilter: aFilterSymbol ^(self filters includes: aFilterSymbol) ifTrue: ['<yes>'] ifFalse: ['<no>'] ! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! toggleFilterState: aFilterSymbol ^(self filters includes: (aFilterSymbol)) ifTrue: [self filterRemove: aFilterSymbol] ifFalse: [self filterAdd: aFilterSymbol]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! uncheckFilters "Uncheck all filters." filters := OrderedCollection new. self noteChanged! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! updateLabel: packagesShown "Update the label of the window." window ifNotNilDo: [:w | w setLabel: (self labelForShown: packagesShown)]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [ map upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. Confirms on each upgrade." ^ self upgradeInstalledPackagesConfirm: true! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade. " | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [^ self inform: 'All ' , installed size printString , ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [^ self inform: 'None of the ' , old size printString , ' old packages of the ' , installed size printString , ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: ['Of the ' , old size printString , ' old packages only ' , toUpgrade size printString , ' can be upgraded. The following packages will not be upgraded: ' , (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info , ' About to upgrade the following packages: ' , (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]) , 'Proceed?') ifTrue: [myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [confirmEach ifTrue: [map upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ' , p installedRelease packageNameWithVersion , ' to ' , (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName , '?']] ifFalse: [map upgradeOldPackages]. self inform: toUpgrade size printString , ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifTrue: [self noteChanged] ifFalse: [self reOpen]]] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\' , ex messageText , '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesNoConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. No confirmation on each upgrade." ^ self upgradeInstalledPackagesConfirm: false! ! !SMPackageWrapper methodsFor: 'comparing' stamp: 'dvf 9/21/2003 16:25' prior: 27998626! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMPackageWrapper methodsFor: 'converting' stamp: 'btr 11/22/2006 00:54' prior: 27998778! asString | string | string := item name, ' (', item versionLabel, ')'. item isInstalled ifTrue: [string := string asText allBold]. "(string includesSubString: '->') ifTrue: [string := string asText color: Color green]." ^ string! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'dvf 10/14/2003 18:58' prior: 27998902! contents ^item releases reversed collect: [:e | SMPackageReleaseWrapper with: e]! ! !SMPackageWrapper methodsFor: 'testing' stamp: 'dvf 9/21/2003 16:25' prior: 27999070! hash ^self withoutListWrapper hash! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:55'! help ^ 'This shows all packages with their releases that should be displayed according the current filter.'! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString! ! !SMPackageWrapper methodsFor: 'printing' stamp: 'dvf 9/21/2003 16:22' prior: 27999192! printOn: aStream aStream nextPutAll: 'wrapper for: ', item printString! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849043! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMCategoryWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 18:53' prior: 27849195! asString ^ item name , ' (' , self numberOfObjects printString , ')'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'ar 2/9/2004 02:35' prior: 27849301! category ^item! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 21:02' prior: 27849402! contents ^ item subCategories collect: [:n | self class with: n model: n]! ! !SMCategoryWrapper methodsFor: 'model access' stamp: 'btr 11/30/2006 21:02'! getList ^ Array with: (self class with: self contents model: model)! ! !SMCategoryWrapper methodsFor: 'testing' stamp: 'btr 11/30/2006 18:53'! hasContents ^ item hasSubCategories! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849700! hash ^self withoutListWrapper hash! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:56'! help ^ 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'BJP 11/22/2002 14:17'! model ^model! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:53'! numberOfObjects " | total | total _ 0. model allCategoriesDo: [:c | total _ total + c objects size]. ^total" ^item objects size! ! !SMPackageReleaseWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 21:30' prior: 27997393! asString "Show installed releases with a trailing asterisk." | string | string := item smartVersion. "Older SMBase versions don't have isInstalled.'" (item respondsTo: #isInstalled) ifTrue: [item isInstalled ifTrue: [string := (string , ' *') asText allBold]]. ^ string! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 17:14'! contents ^ #()! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString ! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47' prior: 27944626! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifAbsent: [self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white ifTrue: ["not set" Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor)]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52' prior: 27945298! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:08' prior: 54331069! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:15' prior: 27927912! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. item ifNil: [^nil]. dir := item isPackage ifTrue: [model cache directoryForPackage: item] ifFalse: [model cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. " withLabel: item name, ' cache directory'." win openInWorld ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:52'! buildButtonBar | aRow btn | aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. self buttonSpecs do: [:spec | btn := self buildButtonNamed: spec first helpText: spec third action: spec second. aRow addMorphBack: btn] separatedBy: [aRow addTransparentSpacerOfSize: 3@0]. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:27'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 19:04' prior: 27928394! buildMorphicCategoriesList "Create the hierarchical list holding the category tree." | list | list := (SimpleHierarchicalListMorph on: self list: #categoryWrapperList selected: #selectedCategoryWrapper changeSelected: #selectedCategoryWrapper: menu: #categoriesMenu: keystroke: nil) autoDeselect: true; enableDrag: false; enableDrop: true; yourself. list setBalloonText: 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'. "list scroller submorphs do:[:each| list expandAll: each]." list adjustSubmorphPositions. ^ list! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:22' prior: 27929139! buildMorphicPackagesList "Create the hierarchical list holding the packages and releases." ^(SimpleHierarchicalListMorph on: self list: #packageWrapperList selected: #selectedItemWrapper changeSelected: #selectedItemWrapper: menu: #packagesMenu: keystroke: nil) autoDeselect: false; enableDrag: false; enableDrop: true; setBalloonText: 'This shows all packages with their releases that should be displayed according the current filter.'; yourself! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:13'! buildPackageButtonBar | aRow | "Somewhat patterned after IRCe's buttonRow method." aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'gk 5/5/2006 02:05' prior: 27929686! buildPackagePane "Create the text area to the right in the loader." | ptm | ptm := PluggableTextMorph on: self text: #contents accept: nil readSelection: nil "#packageSelection " menu: nil. ptm setBalloonText: 'This is where the selected package or package release is displayed.'. ptm lock. ^ptm! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:08' prior: 27930070! buildSearchPane "Cribbed from MessageNames>>inMorphicWindowWithInitialSearchString:" | typeInView searchButton typeInPane | typeInView := PluggableTextMorph on: self text: nil accept: #findPackage:notifying: readSelection: nil menu: nil. typeInView acceptOnCR: true; vResizing: #spaceFill; hResizing: #spaceFill; setTextMorphToSelectAllOnMouseEnter; askBeforeDiscardingEdits: false; setProperty: #alwaysAccept toValue: true. (typeInView respondsTo: #hideScrollBarsIndefinitely) ifTrue: [typeInView hideScrollBarsIndefinitely] ifFalse: [typeInView hideScrollBarIndefinitely]. searchButton := SimpleButtonMorph new target: typeInView; color: Color white; label: 'Search'; actionSelector: #accept; arguments: #(); yourself. typeInPane := AlignmentMorph newRow. typeInPane vResizing: #shrinkWrap; hResizing: #shrinkWrap; listDirection: #leftToRight; addMorphFront: searchButton; addTransparentSpacerOfSize: 6 @ 0; addMorphBack: typeInView; setBalloonText: 'Type into the pane, then press Search (or hit RETURN) to visit the next package matching what you typed.'. ^ typeInPane! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:24'! buttonSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.') ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.') ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.') ('Update' loadUpdates 'Update the package index from the servers.') ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (confirming each).') ('Help' help 'What is this?'))! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:11' prior: 27936393! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoader methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01' prior: 27933585! categoryWrapperList "Create the wrapper list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (model categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list collect: [:cat | SMCategoryWrapper with: cat model: self]! ! !SMLoader methodsFor: 'filter utilities' stamp: 'gk 7/10/2004 15:45' prior: 27913226! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 17:30' prior: 27930584! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.3. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0.0 @ 0.0 corner: 1.0 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0.0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (0.0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0.0 @ horizDivide corner: vertDivide @ 1.0). self addMorph: (self buildPackagePane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1.0 @ 1.0). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self! ! !SMLoader methodsFor: 'interface' stamp: 'gk 7/12/2004 11:14' prior: 27931214! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:01'! defaultLabel ^'SqueakMap Package Loader'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:14' prior: 27917579! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoader methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 00:14' prior: 27923782! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #( #('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.')) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ', (model object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 19:27' prior: 27918212! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description." | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^self]. descriptions := self packageWrapperList collect: [:e | e withoutListWrapper description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:05' prior: 27937041! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:48' prior: 27931447! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by (installed version -> latest version). If there is no arrow, your installed version of the package is the latest. Installed packages and releases are also in bold. The checkbox menu items at the bottom let you modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. If you like a package or have comments on it, please contact the author or the squeak mailing list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://minnow.cc.gatech.edu/squeak/2726' asUrl]! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:13' prior: 27918874! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoader methodsFor: 'actions' stamp: 'mist 8/17/2005 13:56'! installPackageWithDependents: package | myRelease | myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ package installWithDependencies. myRelease = self installedReleaseOfMe ifFalse: [self reOpen]. self noteChanged] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoader methodsFor: 'initialization' stamp: 'gk 4/5/2005 21:17' prior: 27932588! openAsMorph "Open the loader as a Morphic window." "SMLoader new openAsMorph" ^self createWindow openInWorld! ! !SMLoader methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45' prior: 27934165! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list selectedCategory | list := packagesList ifNil: [ packagesList := self packages select: [:p | (filters ifNil: [#()]) allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [ self package: p filteredByCategory: (model object: currFilter)]]]]. selectedCategoryWrapper ifNotNil: [selectedCategory := selectedCategoryWrapper category. list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^list! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/22/2006 14:30' prior: 27937451! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: self buttonSpecs first]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: self buttonSpecs third]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: #('Copy from cache' #cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' ). choices add: #('Force download into cache' #downloadPackageRelease 'Force a download of the selected release into the cache.' )]. choices add: self buttonSpecs second. ^ choices! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:56' prior: 27913703! packagesListIndex: anObject self selectedItemWrapper: (anObject ifNotNil: [anObject = 0 ifFalse: [self packageWrapperList at: anObject]])! ! !SMLoader methodsFor: 'interface' stamp: 'gk 4/5/2005 21:43' prior: 27932888! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." (self respondsTo: selector) ifTrue: [^ self perform: selector] ifFalse: [^ super perform: selector orSendTo: otherTarget]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/26/2006 23:22' prior: 27941030! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. self delete. (Smalltalk at: self class name) open! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 19:17' prior: 27913904! selectedCategory "Return selected category." ^selectedCategoryWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 12/1/2006 15:51' prior: 27914233! selectedCategoryWrapper: aWrapper selectedCategoryWrapper := aWrapper. (aWrapper notNil and: [aWrapper withoutListWrapper objects includes: selectedItemWrapper withoutListWrapper]) ifFalse: [self selectedItemWrapper: nil]. self changed: #selectedCategoryWrapper. self changed: #packageWrapperList.! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/22/2006 19:13' prior: 27914590! selectedItemWrapper: aWrapper selectedItemWrapper := aWrapper. self changed: #selectedItemWrapper. self contentsChanged! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:10' prior: 27941340! selectedPackageOrRelease "Return selected package or package release." ^self selectedItemWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:02' prior: 27935346! updateLabel: packagesShown "Update the label of the window." self setLabel: self defaultLabel , ' (', (packagesShown size < model packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , model packages size printString, ' packages)'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 21:03' prior: 27921197! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ model upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:03' prior: 27941568! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ confirmEach ifTrue: [ model upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ', p installedRelease packageNameWithVersion, ' to ', (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName, '?']] ifFalse: [model upgradeOldPackages]. self inform: toUpgrade size printString, ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifAbsent: [ (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #installedPackageNameList selected: #installedPackagesListIndex changeSelected: #installedPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicNotInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #notInstalledPackageNameList selected: #notInstalledPackagesListIndex changeSelected: #notInstalledPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createFancyWindow "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicNotInstalledPackagesList borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (horizDivide / 2)). self addMorph: (self buildMorphicInstalledPackagesList borderWidth: 0) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setUpdatablePanesFrom: #(#installedPackageNameList #notInstalledPackageNameList ). currentPackageList := #notInstalled. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide). self addMorph: (self buildSearchPane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 17:27'! currentPackageList ^currentPackageList! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'btr 11/30/2006 17:44'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! defaultLabel ^ 'SqueakMap Categorical Package Loader'! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! installedPackageNameList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! installedPackagesListIndex self currentPackageList = #installed ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 15:09'! isOn ^false! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! notInstalledPackageNameList ^self packageList select: [:e | e isInstalled not]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! notInstalledPackagesListIndex self currentPackageList = #notInstalled ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategorical methodsFor: 'private' stamp: 'btr 11/30/2006 20:21'! noteChanged self changed: #installedPackageNameList. self changed: #notInstalledPackageNameList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! SMLoader removeSelector: #paneColorOld! SMLoader removeSelector: #addPackagesTo:at:plus:! "SMLoader"! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! ----STARTUP----{19 April 2010 . 12:31:46 am} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! Smalltalk removeClassNamed: #MCMockClassC! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 59339410! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066043! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066175! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 57066304! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066431! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066565! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066689! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066783! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066859! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066935! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 57067021! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 57067115! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 57067217! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 57067420! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 57067488! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 57067587! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 23101866! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 57068777! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 57068888! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 59339563! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 57067679! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33645350! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645710! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645842! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33645971! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646098! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33646232! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646356! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646450! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646526! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646602! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33646688! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33646782! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33646884! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33647080! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33647148! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33647247! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33647351! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33647608! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33647869! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33648753! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33648927! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653416! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653555! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653766! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654029! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654165! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654418! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654514! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654737! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33654832! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655111! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655198! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33655388! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33656020! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656135! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33649269! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649629! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649761! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33649890! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650017! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33650151! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650275! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654610! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654309! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653921! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33650701! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33650803! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656527! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33650999! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33655542! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33656315! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33651270! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33651527! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33651788! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33652672! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33652846! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 57169526! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668453! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33668066! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668558! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33668861! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33668971! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669096! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33669221! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669331! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:32' prior: 24924985! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33669536! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669436! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669756! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669881! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669986! override ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33666466! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667021! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667137! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33667250! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667361! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667479! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667587! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667655! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667705! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667755! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33667815! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33667893! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33667979! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33668150! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33668192! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33668275! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33666736! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33666835! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33666930! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33666619! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33668351! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33670377! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670737! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670869! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33670998! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671125! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33671259! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671383! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671477! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671553! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671629! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33671715! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33671809! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33671911! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33672107! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33672175! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33672274! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33672378! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33672635! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33672896! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33673780! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33673954! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! Smalltalk removeClassNamed: #MCMockClassC! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678598! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678737! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33678948! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679211! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679347! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679600! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679696! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679919! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33680014! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680293! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680380! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33680570! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33681202! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681317! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33674296! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674656! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674788! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33674917! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675044! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33675178! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675302! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679792! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679491! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33679103! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33675728! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33675830! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681709! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33676026! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33680724! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33681497! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33676297! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33676554! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33676815! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33677699! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33677873! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33670091! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693635! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33693248! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693740! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694043! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694153! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694278! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694403! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694513! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:33' prior: 33669632! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33694718! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694618! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694938! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695063! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695168! override ^ 1! ! ----STARTUP----{29 April 2010 . 11:05:03 am} as /Users/bert/Downloads/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{29 April 2010 . 11:05:16 am} Squeak4.1.image priorSource: 229! ----STARTUP----{27 April 2011 . 11:47:16 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----SNAPSHOT----{27 April 2011 . 6:01:18 pm} Pacman.image priorSource: 229! ----QUIT----{27 April 2011 . 6:01:51 pm} Pacman.image priorSource: 141204! ----STARTUP----{27 April 2011 . 6:04:35 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Field instanceVariableNames:'' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Pacman instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! ----QUIT----{27 April 2011 . 7:38:58 pm} Squeak4.1.image priorSource: 141281! ----STARTUP----{27 April 2011 . 7:39:01 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT----{27 April 2011 . 8:19:22 pm} Squeak4.1.image priorSource: 142242! ----STARTUP----{28 April 2011 . 1:07:38 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields "Answer the value of fields" ^ fields! ! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields: anObject "Set the value of fields" fields := anObject! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:19'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:19'! setUpMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:27' prior: 33697668! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:27'! initializeMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:29' prior: 33698196! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:29'! fdf ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! PacmanServiceProvider removeSelector: #setUpMap! PacmanServiceProvider removeSelector: #initializeMap! PacmanServiceProvider removeSelector: #fdf! Smalltalk removeClassNamed: #PacmanServiceProvider! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:44'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:44'! initMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! Smalltalk removeClassNamed: #PacmanServiceProvider! !Map methodsFor: 'nil' stamp: 'abc 4/28/2011 13:59'! initMap self inform: 'Hello, World!!'. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 14:01' prior: 33699968! initMap self inform: 'Hello, World!!'.! ! Object subclass: #Map instanceVariableNames: 'fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:32' prior: 33700098! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:43' prior: 33700358! initMap self inform: 'Hello, World!!'. n := 50. m := 100. ^self.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:45' prior: 33700506! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! ----QUIT----{28 April 2011 . 11:54:29 pm} Squeak4.1.image priorSource: 142450! ----STARTUP----{29 April 2011 . 7:49:40 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 19:56' prior: 33700662! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:01'! initialize super initialize. self initMap.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:05' prior: 33701019! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:24'! main | m | m := Map new.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:25' prior: 33701337! initMap n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 4/29/2011 20:25' prior: 33701523! main | m | m := Map new. self inform: 'Hello, World!!'.! ! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! ----QUIT----{30 April 2011 . 12:40:44 am} Squeak4.1.image priorSource: 146293! ----STARTUP----{10 May 2011 . 11:55:01 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 11:56' prior: 33701823! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! main! main! ----SNAPSHOT----{10 May 2011 . 12:48:51 pm} Squeak4.1.image priorSource: 147520! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! main! main! self inform: 'Hello, World!!'.! ----QUIT/NOSAVE----{10 May 2011 . 12:50:26 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{10 May 2011 . 12:50:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! self inform: 'Hello, World!!'.! | m |! main! main! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 12:58' prior: 33702246! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:17' prior: 33702889! main | m | m := Map new. self inform: 'Hello, World!!'.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:18' prior: 33703043! main | m | m := Map new. self inform: 'Hello, World!!'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:20' prior: 33703190! main | m | m := Map new. self inform: 'Hello, World!!'. self inform: 'sthg other'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703368! main | m | m := Map new. self inform: 'done'. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703574! main | m | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703712! main | m form | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703886! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:25' prior: 33704067! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 10@10. self inform: 'done'. ! ! | m | m := Map new. m main. ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:26' prior: 33704296! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704580! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704833! main | m form | m := Map new. m initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! Morph subclass: #Game instanceVariableNames: 'form' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Morph subclass: #Game instanceVariableNames: 'form map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Game methodsFor: 'nil' stamp: 'abc 5/10/2011 14:34'! main "starting point of application" | temporary variable names | ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:35' prior: 33705581! main "starting point of application" map := Map new. map initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! Map removeSelector: #main! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:36' prior: 33705741! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:55' prior: 33706070! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'myGraphicsFileName') displayAt: 50@50. "self inform: 'done'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:57' prior: 33706372! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33706695! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33707040! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707387! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: '/home/michael/Desktop/guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707736! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708146! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708495! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "(Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:01' prior: 33708842! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:31' prior: 33709396! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:32' prior: 33709907! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! ----QUIT----{10 May 2011 . 9:33:43 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{11 May 2011 . 10:09:17 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'template fields x y' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:16' prior: 33701637! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711207! initMap "setting up the grid" x := 35. y := 17. "setting up template" "template = Array new: y. fields := Array new: y." fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711463! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'accessing' stamp: 'abc 5/11/2011 10:19' prior: 33697512! fields: anObject "Set the value of fields" fields := anObject! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33710291! main "starting point of application" "map := Map new. map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33712121! main "starting point of application" map := Map new. "map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:22' prior: 33711721! initMap "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:22' prior: 33712511! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33701205! initialize super initialize. self initMap. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33713503! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! Map removeSelector: #initMap! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:38' prior: 33713797! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33713117! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50 asMorph. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33715475! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." ((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33714148! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | Transcript show: j@i. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33716267! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | Transcript show: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:16' prior: 33717765! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | self inform: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:17' prior: 33719222! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33720675! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33722185! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33723763! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 50@50) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33725345! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:44' prior: 33727030! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:57' prior: 33728758! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:11' prior: 33730486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | template at: j - 1 at: i = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" (i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]. "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:12' prior: 33732822! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | ((template at: j - 1) at: i) = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:32' prior: 33735412! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType += 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType += 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:33' prior: 33738008! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType = blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType = blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:34' prior: 33740641! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:37' prior: 33743295! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((x-1)*16)@((y-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:38' prior: 33745992! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:40' prior: 33748777! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 13:40' prior: 33715830! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." "((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33751644! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33754790! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33757779! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:47' prior: 33760769! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:48' prior: 33763801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j <= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:49' prior: 33766833! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:51' prior: 33769999! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 14:01' prior: 33773247! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33776454! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33779649! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33782846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33786083! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:44' prior: 33789318! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:45' prior: 33792555! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:48' prior: 33795706! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= '#' ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:50' prior: 33798859! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:58' prior: 33801932! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank') asMorph. ]. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:00' prior: 33805001! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:01' prior: 33808109! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:03' prior: 33811262! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/black.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:16' prior: 33814460! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! ----QUIT----{12 May 2011 . 12:42:34 am} Squeak4.1.image priorSource: 156201! ----STARTUP----{15 May 2011 . 12:07:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:16' prior: 33817617! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:18' prior: 33821056! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33824352! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" "((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33827752! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33831225! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 50@300) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:33' prior: 33834737! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 0@0) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:43' prior: 33838211! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'nil' stamp: 'abc 5/15/2011 13:15'! renderPlayer: player x: x y: y "render player at a given coordinate"! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 13:22' prior: 33845368! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4.! ! Object subclass: #Map instanceVariableNames: 'template fields x y players' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:27' prior: 33841928! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33845919! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33849381! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:35' prior: 33852872! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:36' prior: 33856361! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:37' prior: 33859848! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33863337! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i) put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33866825! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:22' prior: 33870315! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33873803! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. pics at: 17 put: ''. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33877292! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:31' prior: 33880801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:34' prior: 33884288! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! Object subclass: #Map instanceVariableNames: 'template fields x y players points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:37' prior: 33887775! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:39' prior: 33891470! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:41' prior: 33895119! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:42' prior: 33898834! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:43' prior: 33902579! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:46' prior: 33845567! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player show.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:48' prior: 33910119! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player openeWorld.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:50' prior: 33910377! renderPlayer: player x: x y: y "render player at a given coordinate" player drawOn: ((x-1)*16)+4@((y-1)*16)+4. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:52' prior: 33910600! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33910804! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33911075! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:54' prior: 33906285! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:55' prior: 33911565! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33915486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33919666! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:58'! redrawField: position "redraq part of the map" | temporary variable names | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:08' prior: 33928011! redrawField: position "redraw part of the map" ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928180! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928361! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:12' prior: 33923846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: (35, 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:13' prior: 33928805! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:14' prior: 33928554! redrawField: position "redraw part of the map" ((fields at: (position at: 2)) at: (position at: 1)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33932972! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. "self redrawField: #(35 1)." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33937391! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:18' prior: 33937140! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:19' prior: 33945810! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). field imageForm display. (fields at: y) at: x put: field.! ! game := Game new.! | game | game := Game new. game main. ! Smalltalk removeClassNamed: #Wall! Smalltalk removeClassNamed: #EmptyField! Smalltalk removeClassNamed: #Field! | game | game := Game new. game main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/15/2011 18:13'! template "getter for template" ^template.! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 18:14' prior: 33754392! main "starting point of application" map := Map new. map initialize.! ! Smalltalk removeClassNamed: #Pacman! | game | game := Game new. game main. ! ----QUIT----{15 May 2011 . 6:40:23 pm} Squeak4.1.image priorSource: 266292! \ No newline at end of file | ||
diff --git a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image index 4fd375a..57f1d8d 100644 --- a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image +++ b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image | |||
| Binary files differ | |||
