Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections;
- struct Object
- {
- public int x;
- public int y;
- public string c;
- public ConsoleColor color;
- }
- class Test
- {
- static void RocksMover(Object rockNew)
- {
- rockNew.y = (rockNew.y + 1);
- }
- static void Main()
- {
- List<Object> newList = new List<Object>();
- for (int i = 0; i < 7; i++)
- {
- Object item = new Object();
- item.x = 1;
- item.y = 0;
- item.c = "@";
- item.color = ConsoleColor.Cyan;
- newList.Add(item);
- }
- foreach (var item in newList)
- {
- RocksMover(item);
- }
- foreach (var item in newList)
- {
- Console.WriteLine(item.y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement