Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Game_snake
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Rextester { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); public partial class Form { int len; Point []p; int direction; public Form() { InitializeComponent(); len=5; p= new Point[200]; direction=3; for(int i =0; i<5;i++) { p[i].X=100; p[i].X=100+i*10; } } private void Panel_Paint(object sender, PaintEventArgs e) { for(int i =198; i>0;i--) { p[i+1].X=p[i].X; p[i+1].Y=p[i].Y; } if(direction ==1) { p[i+1].X=p[i].X-10; p[i+1].Y=p[i].Y; } if(direction ==2) { p[i+1].X=p[i].X+10; p[i+1].Y=p[i].Y; } if(direction ==3) { p[i+1].X=p[i].X; p[i+1].Y=p[i].Y-10; } if(direction ==4) { p[i+1].X=p[i].X; p[i+1].Y=p[i].Y+10; } SolidBrushb1= new SolidBrushb1(Color.Brown); for( int i =0; i<len; i++) { e.Graphics.FillElipse(b, p[i].X, p[i].Y, 10, 10); } } private void time1_Tick(object sender, EventArgs e) { panel.Invalidate(); } private void Form_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode==Keys.Left) direction =1; if(e.KeyCode==Keys.Right) direction =2; if(e.KeyCode==Keys.Up) direction =3; if(e.KeyCode==Keys.Down) direction =4; } } public class Program { } } }
run
|
edit
|
history
|
help
0
C
Fórum ➡ DataTable #1's rows that are NOT present in DataTable #2 ♦
Lesson 2
C# Truly Random
asd
HashSet implementation
30272 Example1
merge 2 sorted array
parsowanie daty
Messages