/earth-debugger

Earth Debugger - WWDC 2023 Swift Student Challenge Accepted

Primary LanguageSwiftMIT LicenseMIT

Earth Debugger

๐ŸŽ‰ WWDC 2023 Swift Student Challenge Accepted

Earth Debugger๋Š” ์ฝ”๋”ฉ์„ ์ฒ˜์Œ ์‹œ์ž‘ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์ด ์ฝ”๋”ฉ์„ ์‰ฝ๊ณ , ์ค‘์š”ํ•œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ๋กœ์„œ ๋ฐ›์•„๋“ค์ผ ์ˆ˜ ์žˆ๋„๋ก ์•„ํ”ˆ ์ง€๊ตฌ๋ฅผ ์ฝ”๋”ฉ์œผ๋กœ ๊นจ๋—ํ•˜๊ฒŒ ์น˜๋ฃŒํ•˜์ž๋Š” ๋ชฉํ‘œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

Earth Debugger was born out of the idea of curing a sick planet with coding. The goal is to get people who are new to coding to embrace coding as a tool that is easy and can solve important problems.

  1. Specs
  2. Details
  3. Credit
  4. License

Specs

  • Xcode 14.3 App Playground
  • iPadOS Playground not tested
  • Runnable: Mac(Mac Catalyst), iPad(iPadOS 16), iOS(iOS 16, some UI may not functional)

Details

https://youtu.be/prc4jeNdFfA

Earth Status

์ง€๊ตฌ๋Š” water, air, soil, ocean, deforestation์˜ ๋‹ค์„ฏ ๊ฐ€์ง€ Pollution Factor์™€ motivated, energy์˜ Sustainable Factor๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

๊ถ๊ทน์˜ ๋ชฉํ‘œ๋Š” ๋ชจ๋“  Pollution Factor์˜ ์ˆ˜์น˜๋ฅผ 10% ๋ฏธ๋งŒ์œผ๋กœ ๋งŒ๋“ค์–ด ์ง€๊ตฌ์˜ ํ™˜๊ฒฝ์„ ๊นจ๋—ํ•˜๊ฒŒ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด๋ฉฐ, ์ด๋Š” ์ค€๋น„๋œ ๋ช‡ ๊ฐ€์ง€์˜ ๋ช…๋ น์–ด๋ฅผ ๋ฐฐ์น˜ํ•˜๊ณ  ์‹คํ–‰ํ•จ์œผ๋กœ์จ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Earth has five Pollution Factors - water, air, soil, ocean, deforestation, and two Sustainable Factors - motivated, energy.

The goal is to get all the Pollution Factor values below 10% to clean up the planet, and this can be done by placing and executing a few prepared commands.

Code

๋ชจ๋“  ์ฝ”๋“œ๊ฐ€ ํ•ญ์ƒ ๊ธ์ •์ ์ธ ์˜ํ–ฅ์„ ๋ผ์น˜๊ณ , ์ œ์•ฝ ์—†์ด ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ๊ฒƒ์€ ์•„๋‹™๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ์†Œ๊ณ ๊ธฐ๋Š” ์ƒ์‚ฐํ•˜๊ธฐ ์œ„ํ•ด ๋งŽ์€ ์–‘์˜ ์˜จ์‹ค๊ฐ€์Šค๊ฐ€ ๋ฐœ์ƒํ•˜๊ณ , ๋ชฉ์ดˆ์ง€๋ฅผ ์ง“๊ธฐ ์œ„ํ•ด ์‚ฐ๋ฆผ์ด ํŒŒ๊ดด๋˜์ง€๋งŒ, ์ด๋ฅผ ์ œํ•œํ•œ๋‹ค๋ฉด ์‚ฌ๋žŒ๋“ค์€ ํ™˜๊ฒฝ ๋ฌธ์ œ์— ๋œ ๊ด€์‹ฌ์„ ๊ฐ€์ง€๊ฒŒ ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์˜ˆ์‹œ๋กœ ๋ณด์—ฌ์ง€๋Š” reduceBeef()๋Š” air pollution, soil pollution, deforestation ์ˆ˜์น˜๋ฅผ ๋‚ฎ์ถ”์ง€๋งŒ, ์ด๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” motivated ์ˆ˜์น˜๊ฐ€ ์ถฉ๋ถ„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ด๋Ÿฌํ•œ ์š”์†Œ๋“ค์„ ๊ณ ๋ คํ•˜์—ฌ ์ง€์† ๊ฐ€๋Šฅํ•œ ํ™˜๊ฒฝ ๋ฌธ์ œ ์†”๋ฃจ์…˜์„ ๋งŒ๋“ค์–ด ๋‚ด๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

Not all code will always have a positive impact, and not all code can be executed without constraints.

For example, beef produces a lot of greenhouse gases before it is consumed, and forests are destroyed to build pastures, but if we restricted it, people would care less about environmental issues.

The example reduceBeef() will reduce the air pollution, soil pollution, and deforestation values, but requires a sufficient motivated value to execute.

It's important to place code blocks with these sustainability factors in mind.

Result

์ „๋žต์ด ์™„์„ฑ๋˜์—ˆ๋‹ค๋ฉด Run ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์ด๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‹คํ–‰์ด ์™„๋ฃŒ๋˜๋ฉด ์ง€๊ตฌ๊ฐ€ ๊นจ๋—ํ•ด์กŒ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ณ , ์ฝ”๋“œ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ์‹คํ–‰๋˜์—ˆ๋Š”์ง€ ์—ฌ๋ถ€์™€ ํ•ด๋‹น ์ฝ”๋“œ๊ฐ€ ๋ผ์นœ ์˜ํ–ฅ, ๊ทธ๋ฆฌ๊ณ  ๋งŒ์•ฝ ์‹คํ–‰๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด ๊ทธ ์ด์œ ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ์ƒ๊ณผ ๋‹ค๋ฅด๊ฒŒ ์‹คํ–‰๋˜์—ˆ๋‹ค๋ฉด ๊ฒฐ๊ณผ์ฐฝ์„ ๋ณด๊ณ  ์ˆ˜์ •ํ•œ ์ดํ›„ ๋‹ค์‹œ ์‹œ๋„ํ•ด๋ณผ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

Once your strategy is complete, you can run it by pressing the Run button.

After running, you can see if the planet is clean, if the code ran successfully, and what impact it had. If it failed, you'll also be able to check why.

If the result is not what you expected, you can fix it and try again.

Credit

License

License