Beruflich Dokumente
Kultur Dokumente
• Bioinformatics is the use of information technology for the study, collection, and storage of genomic
and other biological data.
• Biological Earth Sciences are the use of earth sciences, such as geography, in the study of living things.
• Biological Psychology is the application of biology to the study of the human mind.
• Bio semiotics is the study of biological processes through semiotics, by applying the models of
meaning-making and communication.
• Conservation biology is the study of preservation, restoration, and protection of the natural
environment.
• Cryobiology is the study of lower than normally preferred temperatures on living beings.
• Developmental biology is the study of the processes through which an organism forms.
• Ecology is the study of the relationships of living things to each other and to the environment.
• Embryology is the study of the formation and development of living things from fertilization to birth as
independent organisms.
• Environmental biology is the study of the natural world especially as affected by human activity.
• Evolutionary biology is the study of the origin and descent of species over time.
• Genetics is the study of heredity and the lifelong development of living things.
ConsoleKeyInfo key;
do
key = Console.ReadKey(true);
if (key.Key != ConsoleKey.Backspace)
pass += key.KeyChar;
Console.Write("*");
else
Console.Write("\b");
Console.WriteLine();
namespace MaffeluDemo
{
class Program
{
const ConsoleColor HERO_COLOR = ConsoleColor.DarkBlue;
const ConsoleColor BACKGROUND_COLOR = ConsoleColor.Green;
ConsoleKeyInfo keyInfo;
while ((keyInfo = Console.ReadKey(true)).Key !=
ConsoleKey.Escape)
{
switch (keyInfo.Key)
{
case ConsoleKey.UpArrow:
MoveHero(0, -1);
break;
case ConsoleKey.RightArrow:
MoveHero(1, 0);
break;
case ConsoleKey.DownArrow:
MoveHero(0, 1);
break;
case ConsoleKey.LeftArrow:
MoveHero(-1, 0);
break;
}
}
}
/// <summary>
/// Paint the new hero
/// </summary>
static void MoveHero(int x, int y)
{
Coordinate newHero = new Coordinate()
{
X = Hero.X + x,
Y = Hero.Y + y
};
if (CanMove(newHero))
{
RemoveHero();
Console.BackgroundColor = HERO_COLOR;
Console.SetCursorPosition(newHero.X, newHero.Y);
Console.Write(" ");
Hero = newHero;
}
}
/// <summary>
/// Overpaint the old hero
/// </summary>
static void RemoveHero()
{
Console.BackgroundColor = BACKGROUND_COLOR;
Console.SetCursorPosition(Hero.X, Hero.Y);
Console.Write(" ");
}
/// <summary>
/// Make sure that the new coordinate is not placed outside the
/// console window (since that will cause a runtime crash
/// </summary>
static bool CanMove(Coordinate c)
{
if (c.X < 0 || c.X >= Console.WindowWidth)
return false;
if (c.Y < 0 || c.Y >= Console.WindowHeight)
return false;
return true;
}
/// <summary>
/// Paint a background color
/// </summary>
/// <remarks>
/// It is very important that you run the Clear() method after
/// changing the background color since this causes a repaint of
the background
/// </remarks>
static void SetBackgroundColor()
{
Console.BackgroundColor = BACKGROUND_COLOR;
Console.Clear(); //Important!
}
/// <summary>
/// Initiates the game by painting the background
/// and initiating the hero
/// </summary>
static void InitGame()
{
SetBackgroundColor();
MoveHero(0, 0);
}
}
/// <summary>
/// Represents a map coordinate
/// </summary>
class Coordinate
{
public int X { get; set; } //Left
public int Y { get; set; } //Top
}
}