Các bạn tham khảo bài này ngen.Chạy vui lém.Do Tuấn viết.
- Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int i, j, x, y;
Lap1: i = 30; j = 50;
for (; ; )
{
i++;
j++;
Console.ForegroundColor = ConsoleColor.Green;
Console.SetCursorPosition(i, j);
Console.Write(" ** && **");
Console.Beep(37, 100);
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(i, j);
Console.Write("&&");
Console.Beep(37, 100);
Console.SetCursorPosition(i, j);
Console.Write(" ");
if (j == 70) goto Lap2;
}
Lap2: i = 50; j = 70;
for (; ; )
{
i++;
j--;
Console.ForegroundColor = ConsoleColor.Green;
Console.SetCursorPosition(i, j);
Console.Write(" ** && **");
Console.Beep(37, 100);
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(i, j);
Console.Write("&&");
Console.Beep(37, 100);
Console.SetCursorPosition(i, j);
Console.Write(" ");
if (j == 50) goto Lap3;
}
Lap3: i = 70; j = 50;
for (; ; )
{
i--;
j--;
Console.ForegroundColor = ConsoleColor.Green;
Console.SetCursorPosition(i, j);
Console.Write(" ** && **");
Console.Beep(37, 100);
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(i, j);
Console.Write("&&");
Console.Beep(37, 100);
Console.SetCursorPosition(i, j);
Console.Write(" ");
if (j == 30) goto Lap4;
}
Lap4: i = 50; j = 30;
for (; ; )
{
i--;
j++;
Console.ForegroundColor = ConsoleColor.Green;
Console.SetCursorPosition(i, j);
Console.Write(" ** && **");
Console.Beep(37, 100);
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(i, j);
Console.Write("&&");
Console.Beep(37, 100);
Console.SetCursorPosition(i, j);
Console.Write(" ");
if (j == 50)
{
goto Lap10;
}
}
Lap10: x = 30; y = 50;
for (; ; )
{
x++;
y++;
Console.ForegroundColor = ConsoleColor.Red;
Console.SetCursorPosition(x, y);
Console.Write("Tuan Pro");
Console.Beep(37, 100);
Console.SetCursorPosition(x, y);
Console.Write(" ");
if (y == 70) goto Lap20;
}
Lap20: x = 50; y = 70;
for (; ; )
{
x++;
y--;
Console.ForegroundColor = ConsoleColor.Green;
Console.SetCursorPosition(x, y);
Console.Write("Du Pro");
Console.Beep(37, 100);
Console.SetCursorPosition(x, y);
Console.Write(" ");
if (y == 50) goto Lap30;
}
Lap30: x = 70; y = 50;
for (; ; )
{
x--;
y--;
Console.ForegroundColor = ConsoleColor.Blue;
Console.SetCursorPosition(x, y);
Console.Write("Hung Pro");
Console.Beep(37, 100);
Console.SetCursorPosition(x, y);
Console.Write(" ");
if (y == 30) goto Lap40;
}
Lap40: x = 50; y = 30;
for (; ; )
{
x--;
y++;
Console.ForegroundColor = ConsoleColor.Magenta;
Console.SetCursorPosition(x, y);
Console.Write("Dat Pro");
Console.Beep(37, 100);
Console.SetCursorPosition(x, y);
Console.Write(" ");
if (y == 50) goto Lap1;
}
}
}
}
Được sửa bởi tdat00 ngày Thu Apr 16, 2009 9:21 am; sửa lần 2. (Reason for editing : join topics)