forked from expload/pravda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arrays.cs
49 lines (38 loc) · 1.17 KB
/
arrays.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using Expload.Pravda;
[Program]
public class ProgramArrays
{
public Mapping<Bytes, Bytes> bytes = new Mapping<Bytes, Bytes>();
public void WorkWithBytes() {
byte[] arr1 = new byte[] {1, 2, 3};
Bytes bytes1 = new Bytes(4, 5, 6);
Bytes bytes2 = new Bytes(7, 8, 9);
byte b1 = arr1[0];
byte b2 = arr1[2];
byte b3 = bytes1[1];
byte b4 = bytes2[1];
Bytes bytes3 = bytes1.Slice(1, 2);
bytes.put(bytes1, bytes2);
if (bytes.exists(new Bytes(8, 9, 10))) {
bytes.put(bytes1, new Bytes(7, 8, 9));
}
arr1[0] = 2;
arr1[1] = 1;
int len = bytes1.Length();
}
public void WorkWithArrays() {
char[] chars = new char[] { 'a', 'b', 'c' };
int[] ints = new int[] { 1, 2, 3 };
double[] doubles = new double[] { 1.0, 2.0, 3.0 };
string[] strings = new string[] { "abc", "def", "rty" };
uint[] uints = new uint[] { 4, 5, 6 };
chars[1] = 'd';
ints[1] = 4;
doubles[1] = 4.0;
strings[1] = "asdf";
uints[1] = 7;
int len = strings.Length;
}
static public void Main () {}
}