{"id":19468659,"url":"https://github.com/pharo-graphics/tutorials","last_synced_at":"2025-04-25T11:32:32.289Z","repository":{"id":113718326,"uuid":"90839728","full_name":"pharo-graphics/Tutorials","owner":"pharo-graphics","description":"I contain the code that results from tutorials on Bloc.","archived":false,"fork":false,"pushed_at":"2025-04-24T12:57:08.000Z","size":503,"stargazers_count":9,"open_issues_count":5,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-24T13:43:54.697Z","etag":null,"topics":["bloc","memory-game","pharo","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pharo-graphics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-10T08:25:50.000Z","updated_at":"2025-04-24T12:57:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e92a1a28-2f0b-48f0-b7e3-1fce7bac8be4","html_url":"https://github.com/pharo-graphics/Tutorials","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pharo-graphics%2FTutorials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pharo-graphics%2FTutorials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pharo-graphics%2FTutorials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pharo-graphics%2FTutorials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pharo-graphics","download_url":"https://codeload.github.com/pharo-graphics/Tutorials/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250808365,"owners_count":21490655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bloc","memory-game","pharo","tutorial"],"created_at":"2024-11-10T18:43:09.025Z","updated_at":"2025-04-25T11:32:31.923Z","avatar_url":"https://github.com/pharo-graphics.png","language":"Smalltalk","readme":"# Tutorials for Bloc\n\n[![License](https://img.shields.io/github/license/pharo-graphics/Tutorials.svg)](./LICENSE)\n[![Tests](https://github.com/pharo-graphics/Tutorials/actions/workflows/test.yml/badge.svg)](https://github.com/pharo-graphics/Tutorials/actions/workflows/test.yml)\n\nThis repository contains examples of [Bloc](https://github.com/pharo-graphics/Bloc).\n\n\n## Installation\n\nIn [Pharo](https://pharo.org/download), evaluate:\n\n```smalltalk\nMetacello new\n    baseline: 'BlocTutorials';\n    repository: 'github://pharo-graphics/Tutorials:master/src';\n    load\n```\n\n\n## Memory Game Tutorial\n\nThis is a Memory Card game. Please, find the code at the `Bloc-Memory` package.\n\nThe present code is the result of following the Bloc tutorial in [this booklet](https://files.pharo.org/books-pdfs/booklet-Bloc/2017-11-09-memorygame.pdf), with some little name adaptations.\nThe source code for such booklet can be found [here](https://github.com/SquareBracketAssociates/Booklet-BuildingMemoryGameWithBloc).\n\n![Window](OSWindow.png)\n\nTo start it, evaluate this code:\n\n```smalltalk\n\"Create the game model and the Bloc element.\"\naGameElement := MGGameElement new\n\tmemoryGame: MGGame withNumbers;\n\tyourself.\n\n\"The space represents the window\"\nspace := BlSpace new.\nspace root addChild: aGameElement.\n\n\"Resize the space to the extent of the game board for the first time (this is known when the layout is applied)\"\nspace root whenLayoutedDoOnce: [ space extent: aGameElement size ].\n\n\"Show the window\"\nspace show.\n```\n\nBy default, a OS \"external\" window will popup. It is also possible to popup a Morphic window. To do it, open \"System Settings \u003e Appearance \u003e Bloc\" and select \"SDL2\" in \"Preferable Host\".\n\n\n## Reordering Examples\n\nThis example shows how to use drag-and-drop, and it's written using Bloc.\n\nTo execute it, evaluate the following code:\n\n```smalltalk\nBlPaneCreatingReorderingHandler new fittingColumnsExample\n```\n\nThanks @StephanEggermont for the contribution.\n\n\n## License\n\nThis code is licensed under the [MIT license](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpharo-graphics%2Ftutorials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpharo-graphics%2Ftutorials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpharo-graphics%2Ftutorials/lists"}