private static void movingthetortoise100pixels() { var start = Tortoise.GetY(); Tortoise.Move(100); Homework.CheckAnswer(Tortoise.GetY(), equals, start - 100); }
public static void Start() { Tortoise.Show(); Tortoise.Hide(); Tortoise.SetX(225); Tortoise.SetY(150); Tortoise.SetSpeed(10); ColorWheel.AddColor(Colors.Crimson); ColorWheel.AddColor(Colors.DarkRed); ColorWheel.AddColor(Colors.FireBrick); for (int i = 0; i < 6; i++) { Tortoise.SetPenColor(ColorWheel.GetNextColor()); Tortoise.Move((i + 1) * 4); Tortoise.Turn(-360.0 / 6); for (int j = 0; j < 15; j++) { Tortoise.SetPenWidth(17); Tortoise.Move((j + 1) * 8); Tortoise.Turn(360.0 / 5); } //--Tortoise.getBackgroundWindow().setBackground(PenColors.Yellows.PeachPuff); } Tortoise.SetX(300); Tortoise.SetY(200); for (int i = 0; i < 5; i++) { Tortoise.SetPenColor("Black"); Tortoise.Move(25); Tortoise.Turn(360.0 / 5); } }
public static void Start() { Tortoise.Show(); Tortoise.SetSpeed(10); ColorWheel.AddColor(Colors.BlueViolet); ColorWheel.AddColor(Colors.Violet); ColorWheel.AddColor(Colors.Purple); for (int i = 0; i < 75; i++) { try { //var aaa = 100 / i; var nextColor = ColorWheel.GetNextColor(); Tortoise.SetPenColor(nextColor); Tortoise.Move((i + 1) * 5); Tortoise.Turn(360.0 / 3); } catch (Exception re) { MessageBox.ShowMessage("Hold up: " + re); } } }
public static void Main2() { Tortoise.Show(); Tortoise.SetSpeed(10); Tortoise.InstantSpeed(false); //var sides = MessageBox.AskForInput("Hány oldal legyen?"); // int - integer - egész szám var sides = 25; //Tortoise.SetPenColor(Colors.GetRandomColor()); for (int i = 0; i < sides; i = i + 1) { var color = Colors.GetRandomColor(); Tortoise.SetPenColor(color); // string - szöveg Tortoise.SetPenWidth(i * 2); Tortoise.Move(i * 1.5); Tortoise.Turn(-3 * 360.0 / sides); //string s1 = 'a'.ToString(); //char c1 = 'a'; //string sdf = "" + 3; // 360.0 / 13; // 360.0 / 13.0; //new Random().Next(); // 360 /13 => int / int => 27 // 360.0/13 => double / int => 27.69... // 360 - int // 360.0 - double } }
private static void DrawTriangle(int length) { for (int i = 0; i < 3; i++) { Tortoise.Turn(360.0 / 3); Tortoise.Move(length); } }
private static void DrawOctagonWithOverlap() { for (int i = 0; i < 8 + 1; i++) { Tortoise.Move(110); Tortoise.Turn(360.0 / 8); } }
private static void movingthetortoise100pixels() { var start = Tortoise.GetY(); //240 Tortoise.Move(100); // var end = Tortoise.GetY(); Homework.CheckAnswer(start - 100, equals, Tortoise.GetY()); }
private static void DrawBranch(int currentBranchLength) { if (currentBranchLength > 0) { AdjustColor(currentBranchLength); Tortoise.Move(currentBranchLength); DrawLowerBranches(currentBranchLength); } }
private static void MoveToTheSquareStart(double length) { Tortoise.PenUp(); Tortoise.Move(length / 2); Tortoise.Turn(-90); Tortoise.Move(length / 2); Tortoise.Turn(180); Tortoise.PenDown(); }
private static void MoveBackToCenter(double length) { Tortoise.PenUp(); Tortoise.Turn(90); Tortoise.Move(length / 2); Tortoise.Turn(90); Tortoise.Move(length / 2); Tortoise.Turn(180); Tortoise.PenDown(); }
public static void DrawTriangle(double lineLength) { Console.WriteLine(lineLength); for (int i = 0; i < 3; i++) { Tortoise.Move(lineLength); Tortoise.Turn(360.0 / 3); } }
private static void DrawLowerBranches(int currentBranchLength) { Tortoise.Turn(30); DrawShorterBranch(currentBranchLength); Tortoise.Turn(-60); DrawShorterBranch(currentBranchLength); Tortoise.Turn(30); AdjustColor(currentBranchLength); Tortoise.Move(-currentBranchLength); }
private static void DrawOctogon() { for (int i = 0; i < 8; i++) { var nextColor = ColorWheel.GetNextColor(); Tortoise.SetPenColor(nextColor); Tortoise.Move(50); Tortoise.Turn(360.0 / 8); } }
private static void DrawHouse(int heigthOfHouse) { Tortoise.Move(heigthOfHouse); Tortoise.Turn(90); Tortoise.Move(30); Tortoise.Turn(90); Tortoise.Move(heigthOfHouse); Tortoise.Turn(-90); Tortoise.Move(20); Tortoise.Turn(-90); }
private static void DrawPentagon() { for (int i = 0; i < 200; i++) { AdjustPen(); var length = i; Tortoise.Move(length); Tortoise.Turn(360.0 / 5); Tortoise.Turn(1); } }
private static void drawHouse(int height) { Tortoise.SetPenColor(Colors.GetRandomColor()); Tortoise.Move(height); Tortoise.Turn(90); Tortoise.Move(30); Tortoise.Turn(90); Tortoise.Move(height); Tortoise.Turn(-90); Tortoise.Move(20); Tortoise.Turn(-90); }
public static void Main() { Tortoise.Show(); Tortoise.SetSpeed(10); var sides = 100; for (int i = 0; i < sides; i++) { Tortoise.SetPenColor("interblue"); Tortoise.SetPenWidth(new Random().Next(1, 10)); Tortoise.Move(100); Tortoise.Turn(100); } }
public static void Start() { Tortoise.Show(); Tortoise.SetSpeed(10); var side = 2; for (int i = 0; i < 75; i++) { // Set the current pen color to yellow --#6.1 Tortoise.SetPenColor(Colors.Yellow); // Use the current pen color for the line the tortoise draws --#6.2 side++; Tortoise.Move(side); Tortoise.SetX(555); Tortoise.SetY(65); Tortoise.Turn(360.0 / 3); Tortoise.Turn(1); } }
public static void Main2(String[] args) { setUpPyramidLand(); Tortoise.Turn(-90); Tortoise.Move(220); Tortoise.Turn(+135); Tortoise.Move(100); Tortoise.Turn(90); Tortoise.Move(100); Tortoise.Turn(-90); Tortoise.Move(100); Tortoise.Turn(+90); Tortoise.Move(100); Tortoise.Turn(-90); Tortoise.Move(100); Tortoise.Turn(+90); Tortoise.Move(100); Tortoise.Turn(+135); Tortoise.Move(210); }
public static void Main() { Tortoise.Show(); Tortoise.SetSpeed(10); var sides = MessageBox.AskForInput("How many sides?"); for (int spins = 1; spins < sides; spins++) { for (int i = 0; i < sides; i++) { Tortoise.SetPenColor(Colors.GetRandomColor()); Tortoise.Move(100); Tortoise.Turn((360.0 * spins) / sides); } System.Threading.Thread.Sleep(100); //ProgramWindow.Clear(); Tortoise.Show(); } }
public static void Start() { Tortoise.Show(); Tortoise.SetX(150); Tortoise.SetY(200); //Tortoise.SetSpeed(10); Tortoise.InstantSpeed(true); for (int i = 0; i < 360; i++) { Tortoise.Move(3); Tortoise.Turn(1); if (i % 20 == 0) { for (int j = 0; j < 360; j++) { Tortoise.Move(1); Tortoise.Turn(1); Tortoise.SetPenWidth((j + 100) / 100); } } } }
private static void MakeASquare(double length) { if (length > 10) { MoveToTheSquareStart(length); for (int i = 0; i < 4; i++) { Tortoise.Move(length); var newLength = length / 1.7; MakeASquare(newLength); if (i < 3) { Tortoise.Turn(90); } } MoveBackToCenter(length); length *= 2; } }
private static void CreateSide() { Tortoise.SetPenColor(Colors.GetRandomColor()); Tortoise.Move(50); Tortoise.Turn(90); }
private static void question2() { Tortoise.Move(110); }
public static void Main() { // Show the tortoise --#1 Tortoise.Show(); Tortoise.SetSpeed(4); // Make the tortoise move as fast as possible --#6 // Do the following 4 times --#5.1 // Change the color of the line the tortoise draws to blue --#4 Tortoise.SetPenColor(GetRandomColorName()); // Move the tortoise 50 pixels --#2 Tortoise.Move(150); // Turn the tortoise 90 degrees to the right --#3 Tortoise.SetSpeed(6); for (int i = 0; i < 10; i++) { // Turn 10% Tortoise.Turn(9); // Repeat --#5.2 Tortoise.SetPenColor(GetRandomColorName()); Tortoise.Move(10); } Tortoise.Turn(90); Tortoise.SetPenColor(GetRandomColorName()); Tortoise.Move(260); Tortoise.Turn(90); Tortoise.SetSpeed(8); Tortoise.Move(3); Tortoise.Turn(90); Tortoise.SetPenColor(GetRandomColorName()); Tortoise.Move(254); Tortoise.Turn(-90); Tortoise.SetPenColor(GetRandomColorName()); for (int i = 0; i < 10; i++) { // Turn 10% Tortoise.Turn(-9); // Repeat --#5.2 Tortoise.Move(10); Tortoise.SetSpeed(10); Tortoise.SetPenColor(GetRandomColorName()); } Tortoise.Move(135); Tortoise.Turn(90); Tortoise.Move(12); Tortoise.Turn(180); Tortoise.Move(65); Tortoise.SetSpeed(12); Tortoise.SetPenColor(GetRandomColorName()); Tortoise.Turn(90); Tortoise.Move(52); Tortoise.Turn(270); }
//Question4 //Create a subroutine called movethelength // that moves the Tortoise the current length private static void movethelength() { Tortoise.Move(length); }
private static void CreateAStitch() { Tortoise.Move(6); }