Code Monkey home page Code Monkey logo

cs50-darwin's Introduction

cs50-darwin

Allopatric Speciation Simulator

What this app does: It simulates the process of allopatric speciation by allowing the user to change the landscape and displaying the changes in species populations per an algorithm. The app starts with a single landmass in the middle of an ocean. Species populations are represented by colored regions on top of land. Tap anywhere on the water to create a piece of land. Tap anywhere on land (some species may be occupying it) to submerge it below water. The app recalculates the populations after any change is made to the landscape. Tap ‘reset’ to revert the view back to the original. Shake the device to simulate a founder event, whereby the populations will change and all colors will be different.

Background: Allopatric speciation is a term used in evolutionary biology referring to the evolution of new species due to events that cause geographic separation, or vicariance events. An example of a vicariance event is rising sea levels, which may submerge land bridges and create two separate landmasses which were once connected. The result is allopatric speciation, whereby the populations of species on the now separated landmasses diverge due to various environmental factors and the absence of gene flow.

Requirements: This is an iOS app made using Apple’s Xcode development software. Download the latest version of Xcode here: https://developer.apple.com/xcode/. The app is not available in the App Store because this requires an approval process/money. Instead, the recreational user can run the app either on their iPhone/iPad or using Xcode’s built-in Simulator (see instructions below.)

The necessary files provided are: Final Project CS50Darwin.xcodeproj AppDelegate.swift Assets.xcassets folder Base.lproj folder CustomColors.swift Info.plist ViewController.swift

If you have downloaded Xcode, opening the first file should bring up the entire collection of source code and storyboards. To run the app on the Simulator, simply select a device from the menu in the left of the top banner and press the play button. To run the app on an iOS device, connect your device to your computer and select the name of your device from the same menu before pressing play. You may need to follow on-screen instructions or change your device settings to allow access to the app.

Understanding: The Final Project CS50Darwin.xcodeproj file encompasses all components that make the app run. AppDelegate.swift is a default file that pulls all the components together to make the iOS app per Apple’s specifications. The Assets.xcassets folder contains some image files, including the app icon. The Base.lproj folder contains Main.storyboard and LaunchScreen.storyboard. Main.storyboard shows the UI, with interactive displays connected to the code. CustomColors.swift was a custom class I created to pick the colors for the different species. Info.plist contains some specifications about the app itself. ViewController.swift is where most of the Swift code is, as it is responsible for responding to user input as well as the algorithm for speciation.

cs50-darwin's People

Contributors

anlizhang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.