Fibonacci Series in Java

Java code written to count and output the Fibonacci sequence.

// Algorithm for Adding Fibonacci Numbers

// @author www.mikestratton.net
public class Fibonacci
{

public static void main(String[] args)
{

int count = 20; // set the number of times the equation runs ** do not exceed 44
int x = 0; int y = 1; // set the initial values to be added
int fib = 0; //  fibonacci number

for (int i = 0; i <= count; i++)
{
fib = x + y;
Read more →

0

Artificial Life – Simple Animation

One of the base things I must accomplish in the creation of a software program that emmulates the evolution and survival of life is a simplistic method of animating graphical objects. The graphics will be able to “see” and therefore will sense when they come in close contact with other objects. After a bit of research and development, I found an existing program, written in Java, that does just this.

The artificial life simulation will take into account the cycle of ...

Read more →
0

Artificial Life – Simple Math

The following code transforms the struggle for survival into a mathematical equation. A user is asked to enter a number of carnivores to create between 1 – 100. Once the number has been decided, the plants, herbivores and carnivores reproduce contingent on a specific ratio between plants:herbivores:carnivores or 16:6:2.

The program takes 3 separate life forms plants, herbivores and carnivores and increases or decreases their reproduction rate depedent on their ratio in comparison to the other life forms. A ratio of ...

Read more →
0
Page 1 of 3 123