Swift Slowly: Day 39 - Hacking Swift 25

Today is a consolidation and challenge day! I’m a quarter of the way through this and I’m pretty excited and grateful to have made it this far. With that comes a little more stress as I’m venturing out on my own to do small challenges along the way.

Which brings me to the challenge!

Challenge

You have a basic understanding of arrays, state, views, images, text, and more, so let’s put them together: your challenge is to make a brain training game that challenges players to win or lose at rock, paper, scissors.

The first thing I did was take some time to sketch out what I want the application to look like.

Rough Sketch with my rubber duck partner.

It really didn’t take that long to get something on screen.

Barebones of an application ui.

I’m taking a lot of the lessons and code from the Guess the flag game that I created earlier in order to move forward with this. I was fun to put the application together and I even spent some time doing some customization.

Application at the end.

What took me the most time, was actually coming up with the logic to the game. Apparently, working on something complex after many days of not getting enough sleep can wear you down. Luckily, there is pen and paper and the ability to forgive myself and move on.

My note book explaining the logic to myself

I’m just happy to be done!

Categories: SwiftSlowly

Published:

Debug

Site Properties

		&hugolib.SiteInfo{Authors:page.AuthorList(nil), Social:hugolib.SiteSocial(nil), hugoInfo:hugo.Info{CommitHash:"1798bd3f", BuildDate:"2021-12-23T15:33:34Z", Environment:"production"}, title:"Mandaris", RSSLink:"https://mandarismoore.com/feed.xml", Author:map[string]interface {}{"avatar":"https://micro.blog/mandaris/avatar.jpg", "name":"Mandaris Moore", "username":"mandaris"}, LanguageCode:"en", Copyright:"", permalinks:map[string]string{}, LanguagePrefix:"", Languages:langs.Languages{(*langs.Language)(0xc00063dd40)}, BuildDrafts:false, canonifyURLs:false, relativeURLs:false, uglyURLs:(func(page.Page) bool)(0x163ea20), owner:(*hugolib.HugoSites)(0xc0003a3550), s:(*hugolib.Site)(0xc0004b7440), language:(*langs.Language)(0xc00063dd40), defaultContentLanguageInSubdir:false, sectionPagesMenu:""} 

		Second Site

		maps.Params{"description":"Follow <a href=\"https://micro.blog/mandaris\">@mandaris on Micro.blog</a>.", "github_username":"mandaris", "include_conversation":true, "instagram_username":"", "itunes_author":"Mandaris", "itunes_category":"Society & Culture", "itunes_cover":"https://micro.blog/mandaris/podcast.png", "itunes_description":"A High-quality stranger. I've considered myself a digital gofer. Y'know, go for this and go for that. I'm using micro.blog now to par down my technical projects and be part of an outstanding community.  Apple Game Center: MrMandaris  Email: Contact@MandarisMoore.com", "itunes_email":"podcast@mandarismoore.com", "itunes_subcategory":"Personal Journals", "mainSections":[]string{"replies"}, "mainsections":[]string{"replies"}, "paginate_categories":true, "paginate_home":true, "paginate_replies":true, "plugins_css":[]interface {}{}, "plugins_html":[]interface {}{}, "plugins_js":[]interface {}{}, "site_id":"661", "theme_seconds":"1669566281", "twitter_username":"mandaris"}
		
		Permalink
		"https://mandarismoore.com/2021/02/05/swift-slowly-day.html" 

		
		Page Information
		
		
		
		

Params

		map[categories:[SwiftSlowly] date:2021-02-05 00:02:20 -0800 -0800 draft:%!s(bool=false) guid:http://mandaris.micro.blog/2021/02/05/swift-slowly-day.html images:[https://mandarismoore.com/uploads/2021/ccf2b61346.jpg https://mandarismoore.com/uploads/2021/cfe689623e.png https://mandarismoore.com/uploads/2021/be4cafb23a.png https://mandarismoore.com/uploads/2021/d99a02de4f.jpg] iscjklanguage:%!s(bool=false) lastmod:2021-02-05 00:02:20 -0800 -0800 layout:post microblog:%!s(bool=false) photos:[https://mandarismoore.com/uploads/2021/ccf2b61346.jpg https://mandarismoore.com/uploads/2021/d99a02de4f.jpg] photos_with_metadata:[map[height:%!s(int=600) url:https://mandarismoore.com/uploads/2021/ccf2b61346.jpg width:%!s(int=450)] map[height:%!s(int=600) url:https://mandarismoore.com/uploads/2021/d99a02de4f.jpg width:%!s(int=450)]] publishdate:2021-02-05 00:02:20 -0800 -0800 title:Swift Slowly: Day 39 - Hacking Swift 25 type:post url:/2021/02/05/swift-slowly-day.html]