Skip to content

a colab project for students to explore building a simple simulation from scratch based on a specification.

Notifications You must be signed in to change notification settings

nss-group-projects/single-cell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Single Cell: There Can Be Only One

Project

This is a colab project to explore building a simple text-based application from scratch, based on a specification. It simulates a micro-ecosystem, where cells collide and the larger one consumes the smaller until only one remains. It's based on a superb tablet game called Osmos. Think about how to organize this code. You will probably have to research a bit to figure out how to build some parts.

Specifications

Create an array of strings representing the names of all the contenders.

Using that array, populate an array of contenders, each an object with properties for name and size, which should start as 1.

Use a while loop to iterate as long as there's more than one contender. Each iteration, make two of the contenders battle

  • select two different contenders at random from the array
  • compare their sizes (you can choose how to break a tie)
  • increase the size of the larger by 1, and remove the smaller from the array
  • log some information about the battle and outcome.

Finally, log some information about the remaining winner.

Next Steps

Do you have any other ideas to make this more interesting? Have fun with it!

About

a colab project for students to explore building a simple simulation from scratch based on a specification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published