Code Monkey home page Code Monkey logo

wa-tor's Introduction

Wa-Tor

Introduction

Wa-Tor is a simulation which simulates the feeding- and reproductive behavior of sharks and fish. Sharks feed on the fish and the food of the fish is unknown. That the simulation works, there are some rules:

The Ocean consists of a square Grid. The opposite Sides are stapled. That means that when the shark or fish want to swim on one side he comes out on the opposite side out again.

rules for fish: Each fish swims randomly to one of the four fields, if it is empty. Each fish has an age, exeeds this age the "Breed Time", so a new fish is born on an empty field.

rules for sharks: sharks feed on the fish. If a shark don´t find a fish on an adjacent field, so he swims to one of the free, adjacent fields. Sharks reproduce exactly the same way as a fish.

Requirements

  • for Mac and possibly for Windows
  • language: Python
  • Documentation

Goals

  • a window with the simulation
  • a header
  • under the heading, the number of steps (simulations time)

wa-tor's People

Contributors

jasmin19 avatar seletz avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wa-tor's Issues

code: Format code with 4 spaces

Problem

The code currently does not use the python standard of four blanks to indent code.

Tasks

  • Have @Janislav help you to configure atom correctly for python
  • reformat all the code in the repository

code talk: Data Structures I

Problem

Most, if not all, programs manipulate data. Thinking about the structure of the manipulated data first is one of the things a programmer needs to learn.

In this installment we will discuss very simple data structures and how to use them:

  • numbers, booleans, strings
  • tuples
  • lists
  • dictionaries

code: Use python docstring format for function documentation

def create_shark(id):
    """
    create_shark(id) -> a dict

    This function crea a shark objectwhich we can place in our ocean.

    @param id: the id of a new shark

    @returns:  a shark
    """
    #
    #
    #This function crea a shark objectwhich we can place in our ocean.
    #
    #The shark object should look like this.
    # {
    #  "id": id,
    #   "cordiantes":
    # }
    #
    return -1

Initial Project Documentation

Problem

We have a project, but no documentation as of what we need to do, or what the actual tasks are.

Tasks

  • Note down the things you got from the project kickoff (=>readme.rst)

mainloop: Change the code such that the main loop is able to count up and down

Problem

The main loop currently can either count up or down, depending on the if in the mainloop function.

That's not good. We want the main loop to work in both cases.

Requirements

The main loop must work with all combinations of start, increment and stop parameters.
You may -- for now -- ignore pathological cases.

Deliverable

  • Working code
  • Documented Function
  • Test examples

Hints

For the second task:

  • You will need to pass more than one parameter to the new function
  • You will need to return something from the new function

Tasks

  • Change the code in the main loop which tests if the loop should stop
  • Extract ("refactor") the code such that the decision to stop is made in a function called ist_simulation_fertig. See the hints

code talk: Expressions, Functions, Scope and Modules in Python

Problem

We're going to talk about expressions and their evaluation. We're discuss functions and how we're going to call them. We're also talking about where functions "live" (modules).

We do this while implementing the main loop of the wa-tor simulation.

Goal

Having a working main loop which counts and displays the simulation time.

Tasks

  • Codeacademy Python: "Syntax"
  • Review main loop code
    • run the code on your machine
    • change the code
    • add more mainloop runs
    • change the output
    • ...

Questions

Does the main loop work backwards in time? 10 to 0? Do you need to change the function "mainloop" for that? If so, why? Why not?

Initialize the world

Problem

The world initializaton code is not yet finished.

Tasks

  • Finish the code in the init_welt() function. Use 1 for fish and 2 for sharks
  • Refactor the parts which create fish and sharks to their own functions
  • Now change the fish and shark creation functions to use an array instead of a simple number:
    • sharks: [2, <<alter>>, <<hunger>>]
    • fish: [1, <<alter>>]
  • Change the display function such that it works again

Create a basic architecture for the application and analyse the problem.

Problem

The implementation of the problem is quite difficult for us, because the problem is currently in a undefined status. To get an idea of how to solve the problem, we need to have to think first about the problem and create a basic application architecture.

Todo

  • Make some research (play around) about how to implement the simulation
  • Define a basic application structure with some stamp function which are describing smaller parts of
    the problems
  • Create specific issues which you recognised while you’re creating the application architecture
  • Create a estimation for the issues

Tip

This has very much todo with software design and the top-down architecture. First you should have a look at the Wiki about this: http://de.wikipedia.org/wiki/Top-Down-_und_Bottom-Up-Design

Initial Project Planning and Estimate

Problem

The customer needs an estimate of the project costs and timeline.

Tasks

  • create a graphic (Ocean, Shark, Fish)
  • Create a basic architecture for the application
  • Create rules that the feeding- and reproductive behaviour of sharks and fishes describes

code talk: Variables, Names and the Box Model

Problem

In this installment of the code talk we'll introduce the box model for thinking about computation.
Next we're going to learn about variables, names and storage locations.

Topics

  • The Box Model of computation
  • Variables and names
  • Storage locations

References

Note, all these use a different programming language called "Lisp" to teach about programming
and general computation. Other than the Syntax, the basics are the same and actually easier
to explain in Lisp. If you feel you're getting confused, take a step back and try to compare the issue with what you learnt about python and what we talked about.

FOR NOW IGNORE THESE

How To Design Programs
http://htdp.org/

Structure And Interpretation Of Computer Programs
http://mitpress.mit.edu/sicp/full-text/book/book.html

Project Setup

Problem

We need a project setup for the wa-tor project. Jasmine needs help in doing this.

Tasks

Initial Project Setup

  • Help Jasmine to download the GitHub for mac app
  • Help Jasmine to create a $HOME/develop/nexiles directory
  • Have Jasmine clone the "wa-tor" project to the develop/nexiles dir

Initial Project Documentation

  • Together, create a top-level readme.rst and create the first commit. Show her how to see and do it in GH for Mac App.
  • Show Jasmine how to edit that documentation through the web

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.