System.Console.WriteLine(uint)

Here are the examples of the csharp api System.Console.WriteLine(uint) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

42 Examples 7

19 View Source File : Exercicio6.36.cs
License : MIT License
Project Creator : atrigo

static void Main(string[] args) 
        {
            uint i, j, k, n;
            uint[] v = new uint[9];
            bool cap;
            for (i = 1; i < 10000; i++)
            {
                n = i;
                j = 0;
                do
                {
                    v[j++] = n % 10;
                    n /= 10;
                }
                while (n > 0);
                cap = true;
                k = 0;
                do
                    if (v[j - 1 - k] != v[k++])
                        cap = false;
                while (j / 2 >= k && cap);
                if (cap)
                    Console.WriteLine(i);
            }
        }

19 View Source File : Exercicio7.10.cs
License : MIT License
Project Creator : atrigo

static void Main(string[] args)
        {
            uint N, contador = 0, num = 0;
            Console.Write("Quantos números primos: ");
            N = Convert.ToUInt32(Console.ReadLine());
            do
            {
                if (Primo(++num))
                {
                    contador++;
                    Console.WriteLine(num);
                }
            } while (contador < N);
        }

19 View Source File : ConsoleOutput.cs
License : MIT License
Project Creator : bartoszgolek

public void WriteLine(uint value)
        {
            Console.WriteLine(value);
        }

19 View Source File : 3332290517694437835.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F2);
    }

19 View Source File : 74926792360430006.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr3 = new S2(new S1(1, new S0(0)));
        System.Console.WriteLine(vr3.F0.F0);
        System.Console.WriteLine(vr3.F0.F1.F1);
    }

19 View Source File : 7942836627444969388.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S4 vr0 = new S4(new S2(1, new S0(1)));
        s_74 >>= vr0.F0.F5;
        System.Console.WriteLine(vr0.F0.F0);
    }

19 View Source File : 7982656990608861765.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1, new S0(false)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F2);
    }

19 View Source File : 5801839439459303867.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1));
        System.Console.WriteLine(vr0.F0.F1);
        System.Console.WriteLine(vr0.F0.F2);
    }

19 View Source File : 5895463538556689318.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr2 = new S2(new S1(1, new S0(0)));
        System.Console.WriteLine(vr2.F0.F2);
        System.Console.WriteLine(vr2.F0.F5);
    }

19 View Source File : 6503679222331064317.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S3 vr0 = new S3(new S1(1, new S0(0)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F2.F0);
    }

19 View Source File : 10413523100954317859.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S3 vr0 = new S3(new S2(new S1(1)));
        System.Console.WriteLine(vr0.F0.F1);
        System.Console.WriteLine(vr0.F0.F2.F3);
    }

19 View Source File : 10720722905867056302.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S0 vr2 = new S0(1);
        if (s_4)
        {
            vr2.F2 = (sbyte)s_16;
        }

        S1 vr3 = new S1(vr2);
        System.Console.WriteLine(vr2.F5);
        System.Console.WriteLine(vr3.F0.F0);
    }

19 View Source File : 11758527823528164096.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(new S0(1)));
        System.Console.WriteLine(vr0.F0.F0.F1);
        System.Console.WriteLine(vr0.F0.F0.F2);
    }

19 View Source File : 12411176586024457617.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S3 vr0 = new S3(new S2(new S1(new S0(1))));
        vr0.F0.F2.F3.F0 = vr0.F0.F2.F3.F0;
        System.Console.WriteLine(vr0.F0.F0);
    }

19 View Source File : 12629915169798360812.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(new S0(1)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F1.F5);
    }

19 View Source File : 12989066591152514334.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(new S0(1)));
        System.Console.WriteLine(vr0.F0.F1);
        System.Console.WriteLine(vr0.F0.F7.F0);
    }

19 View Source File : 15941538739852851632.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S3 vr0 = new S3(new S1(new S0(true)));
        System.Console.WriteLine(vr0.F0.F0.F1);
        System.Console.WriteLine(vr0.F0.F0.F2);
    }

19 View Source File : 16410583843265627399.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1, new S0(0)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F1);
    }

19 View Source File : 16450673771444223325.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1, new S0(0)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F2);
    }

19 View Source File : 17332121036766880281.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr3 = new S2(new S1(new S0(1)));
        System.Console.WriteLine(vr3.F0.F0.F0);
        System.Console.WriteLine(vr3.F0.F0.F1);
    }

19 View Source File : 1843661825086679795.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1, new S0(1)));
        System.Console.WriteLine(vr0.F0.F0);
        System.Console.WriteLine(vr0.F0.F4);
    }

19 View Source File : 2490745386890520526.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr2 = new S2(new S1(new S0(1)));
        System.Console.WriteLine(vr2.F0.F0.F0);
        System.Console.WriteLine(vr2.F0.F0.F2);
    }

19 View Source File : 2980424644467410330.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S3 vr3 = new S3(new S2(1, new S0(0)));
        System.Console.WriteLine(vr3.F0.F1);
        System.Console.WriteLine(vr3.F0.F3);
    }

19 View Source File : 4783833336775509689.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S6 vr1 = new S6(new S4(new S0(1)));
        System.Console.WriteLine(vr1.F0.F1.F0);
        System.Console.WriteLine(vr1.F0.F1.F5);
    }

19 View Source File : 7045557965961317546.cs
License : MIT License
Project Creator : jakobbotsch

public static void Main()
    {
        S2 vr0 = new S2(new S1(1));
        System.Console.WriteLine(vr0.F0.F0.F0);
        System.Console.WriteLine(vr0.F0.F3);
    }

19 View Source File : Program.cs
License : GNU Affero General Public License v3.0
Project Creator : josephworks

static void Main(string[] args)
        {
            Console.Beep();
            Console.WriteLine("Maximum Value: " + int.MaxValue);
            Console.WriteLine("Minimum Value: " + int.MinValue);
            Console.ReadLine();
            byte x = 1;
            sbyte y = 2;
            //char z = 3;
            //decimal d = 9.954758945;
            double b = 22;
            float f = 33;
            int i = 123;
            uint u = 2334;
            long l = 123456789;
            ulong e = 12345678;
            short s = 255;
            ushort h = 12;
            WriteLine(x);
            WriteLine(y);
            //WriteLine(z);
            //WriteLine(d);
            WriteLine(b);
            WriteLine(f);
            WriteLine(i);
            WriteLine(u);
            WriteLine(l);
            WriteLine(e);
            WriteLine(s);
            WriteLine(h);
            //WriteLine("My salary is: " + "{0:c}"+d,f,1);
            ReadLine();
        }

19 View Source File : Program.cs
License : GNU Affero General Public License v3.0
Project Creator : josephworks

public static void Syntax()
        {
            // Use Console.WriteLine to print lines
            Console.WriteLine("Hello World");
            Console.WriteLine(
                "Integer: " + 10 +
                " Double: " + 3.14 +
                " Boolean: " + true);

            // To print without a new line, use Console.Write
            Console.Write("Hello ");
            Console.Write("World");

            ///////////////////////////////////////////////////
            // Types & Variables
            //
            // Declare a variable using <type> <name>
            ///////////////////////////////////////////////////

            // Sbyte - Signed 8-bit integer
            // (-128 <= sbyte <= 127)
            sbyte fooSbyte = 100;
            Console.WriteLine(fooSbyte);

            // Byte - Unsigned 8-bit integer
            // (0 <= byte <= 255)
            byte fooByte = 100;
            Console.WriteLine(fooByte);

            // Short - 16-bit integer
            // Signed - (-32,768 <= short <= 32,767)
            // Unsigned - (0 <= ushort <= 65,535)
            short fooShort = 10000;
            ushort fooUshort = 10000;
            Console.WriteLine(fooShort);
            Console.WriteLine(fooUshort);

            // Integer - 32-bit integer
            int fooInt = 1; // (-2,147,483,648 <= int <= 2,147,483,647)
            uint fooUint = 1; // (0 <= uint <= 4,294,967,295)
            Console.WriteLine(fooInt);
            Console.WriteLine(fooUint);

            // Long - 64-bit integer
            long fooLong = 100000L; // (-9,223,372,036,854,775,808 <= long <= 9,223,372,036,854,775,807)
            ulong fooUlong = 100000L; // (0 <= ulong <= 18,446,744,073,709,551,615)
            Console.WriteLine(fooLong);
            Console.WriteLine(fooUlong);
            // Numbers default to being int or uint depending on size.
            // L is used to denote that this variable value is of type long or ulong

            // Double - Double-precision 64-bit IEEE 754 Floating Point
            double fooDouble = 123.4; // Precision: 15-16 digits
            Console.WriteLine(fooDouble);

            // Float - Single-precision 32-bit IEEE 754 Floating Point
            float fooFloat = 234.5f; // Precision: 7 digits
            Console.WriteLine(fooFloat);
            // f is used to denote that this variable value is of type float

            // Decimal - a 128-bits data type, with more precision than other floating-point types,
            // suited for financial and monetary calculations
            decimal fooDecimal = 150.3m;
            Console.WriteLine(fooDecimal);

            // Boolean - true & false
            bool fooBoolean = true; // or false
            Console.WriteLine(fooBoolean);

            // Char - A single 16-bit Unicode character
            char fooChar = 'A';
            Console.WriteLine(fooChar);

            // Strings -- unlike the previous base types which are all value types,
            // a string is a reference type. That is, you can set it to null
            string fooString = "\"escape\" quotes and add \n (new lines) and \t (tabs)";
            Console.WriteLine(fooString);

            // You can access each character of the string with an indexer:
            char charFromString = fooString[1]; // => 'e'
            // Strings are immutable: you can't do fooString[1] = 'X';

            // Compare strings with current culture, ignoring case
            string.Compare(fooString, "x", StringComparison.CurrentCultureIgnoreCase);

            // Formatting, based on sprintf
            string fooFs = string.Format("Check Check, {0} {1}, {0} {1:0.0}", 1, 2);

            // Dates & Formatting
            DateTime fooDate = DateTime.Now;
            Console.WriteLine(fooDate.ToString("hh:mm, dd MMM yyyy"));

            // Verbatim String
            // You can use the @ symbol before a string literal to escape all characters in the string
            string path = "C:\\Users\\User\\Desktop";
            string verbatimPath = @"C:\Users\User\Desktop";
            Console.WriteLine(path == verbatimPath);  // => true

            // You can split a string over two lines with the @ symbol. To escape " use ""
            string bazString = @"Here's some stuff
on a new line! ""Wow!"", the mreplacedes cried";
            Console.WriteLine(bazString);

            // Use const or read-only to make a variable immutable
            // const values are calculated at compile time
            const int hoursWorkPerWeek = 9001;
            Console.WriteLine(hoursWorkPerWeek);

            ///////////////////////////////////////////////////
            // Data Structures
            ///////////////////////////////////////////////////

            // Arrays - zero indexed
            // The array size must be decided upon declaration
            // The format for declaring an array is follows:
            // <datatype>[] <var name> = new <datatype>[<array size>];
            int[] intArray = new int[10];

            // Another way to declare & initialize an array
            int[] y = { 9000, 1000, 1337 };

            // Indexing an array - Accessing an element
            Console.WriteLine("intArray @ 0: " + intArray[0]);
            // Arrays are mutable.
            intArray[1] = 1;

            // Lists
            // Lists are used more frequently than arrays as they are more flexible
            // The format for declaring a list is follows:
            // List<datatype> <var name> = new List<datatype>();
            List<int> intList = new List<int>();
            List<string> stringList = new List<string>();
            List<int> z = new List<int> { 9000, 1000, 1337 }; // initialize
            // The <> are for generics - Check out the cool stuff section

            // Lists don't default to a value;
            // A value must be added before accessing the index
            intList.Add(1);
            Console.WriteLine("intList @ 0: " + intList[0]);

            // Others data structures to check out:
            // Stack/Queue
            // Dictionary (an implementation of a hash map)
            // HashSet
            // Read-only Collections
            // Tuple (.Net 4+)

            ///////////////////////////////////////
            // Operators
            ///////////////////////////////////////
            Console.WriteLine("\n->Operators");

            int i1 = 1, i2 = 2; // Shorthand for multiple declarations

            // Arithmetic is straightforward
            Console.WriteLine(i1 + i2 - i1 * 3 / 7); // => 3

            // Modulo
            Console.WriteLine("11%3 = " + (11 % 3)); // => 2

            // Comparison operators
            Console.WriteLine("3 == 2? " + (3 == 2)); // => false
            Console.WriteLine("3 != 2? " + (3 != 2)); // => true
            Console.WriteLine("3 > 2? " + (3 > 2)); // => true
            Console.WriteLine("3 < 2? " + (3 < 2)); // => false
            Console.WriteLine("2 <= 2? " + (2 <= 2)); // => true
            Console.WriteLine("2 >= 2? " + (2 >= 2)); // => true

            // Bitwise operators!
            /*
            ~       Unary bitwise complement
            <<      Signed left shift
            >>      Signed right shift
            &       Bitwise AND
            ^       Bitwise exclusive OR
            |       Bitwise inclusive OR
            */

            // Incrementations
            int i = 0;
            Console.WriteLine("\n->Inc/Dec-rementation");
            Console.WriteLine(i++); //Prints "0", i = 1. Post-Incrementation
            Console.WriteLine(++i); //Prints "2", i = 2. Pre-Incrementation
            Console.WriteLine(i--); //Prints "2", i = 1. Post-Decrementation
            Console.WriteLine(--i); //Prints "0", i = 0. Pre-Decrementation

            ///////////////////////////////////////
            // Control Structures
            ///////////////////////////////////////
            Console.WriteLine("\n->Control Structures");

            // If statements are c-like
            int j = 10;
            if (j == 10)
            {
                Console.WriteLine("I get printed");
            }
            else if (j > 10)
            {
                Console.WriteLine("I don't");
            }
            else
            {
                Console.WriteLine("I also don't");
            }

            // Ternary operators
            // A simple if/else can be written as follows
            // <condition> ? <true> : <false>
            int toCompare = 17;
            string isTrue = toCompare == 17 ? "True" : "False";

            // While loop
            int fooWhile = 0;
            while (fooWhile < 100)
            {
                // Iterated 100 times, fooWhile 0->99
                fooWhile++;
            }

            // Do While Loop
            int fooDoWhile = 0;
            do
            {
                // Start iteration 100 times, fooDoWhile 0->99
/*
                if (false)
                    continue; // skip the current iteration
*/

                fooDoWhile++;

                if (fooDoWhile == 50)
                    break; // breaks from the loop completely
            } while (fooDoWhile < 100);

            // for loop structure => for(<start_statement>; <conditional>; <step>)
            for (int fooFor = 0; fooFor < 10; fooFor++)
            {
                // Iterated 10 times, fooFor 0->9
            }

            // For Each Loop
            // foreach loop structure => foreach(<iteratorType> <iteratorName> in <enumerable>)
            // The foreach loop loops over any object implementing IEnumerable or IEnumerable<T>
            // All the collection types (Array, List, Dictionary...) in the .Net framework
            // implement one or both of these interfaces.
            // (The ToCharArray() could be removed, because a string also implements IEnumerable)
            foreach (char character in "Hello World".ToCharArray())
            {
                // Iterated over all the characters in the string
            }

            // Switch Case
            // A switch works with the byte, short, char, and int data types.
            // It also works with enumerated types (discussed in Enum Types),
            // the String clreplaced, and a few special clreplacedes that wrap
            // primitive types: Character, Byte, Short, and Integer.
            //int month = 3;
            //string monthString;
            //switch (month)
            //{
            //    case 1:
            //        monthString = "January";
            //        break;

            //    case 2:
            //        monthString = "February";
            //        break;

            //    case 3:
            //        monthString = "March";
            //        break;
            //    // You can replacedign more than one case to an action
            //    // But you can't add an action without a break before another case
            //    // (if you want to do this, you would have to explicitly add a goto case x
            //    case 6:
            //    case 7:
            //    case 8:
            //        monthString = "Summer time!!";
            //        break;

            //    default:
            //        monthString = "Some other month";
            //        break;
            //}

            ///////////////////////////////////////
            // Converting Data Types And Typecasting
            ///////////////////////////////////////

            // Converting data

            // Convert String To Integer
            // this will throw a FormatException on failure
            int.Parse("123"); // returns an integer version of "123"

            // try parse will default to type default on failure
            // in this case: 0
            int tryInt;
            if (int.TryParse("123", out tryInt)) // Function is boolean
                Console.WriteLine(tryInt);       // 123

            // Convert Integer To String
            // Convert clreplaced has a number of methods to facilitate conversions
            Convert.ToString(123);
            // or
            tryInt.ToString();

            // Casting
            // Cast decimal 15 to an int
            // and then implicitly cast to long
            long x = (int)15M;
            Console.WriteLine(x);
        }

19 View Source File : Class1.cs
License : MIT License
Project Creator : JoshuaWierenga

private static void ConsolePrimitiveTests()
        {
            Console.WriteLine("string Output Test");

            Console.Write('c');
            Console.Write('h');
            Console.Write('a');
            Console.Write('r');
            Console.WriteLine(" Output Test");

            char[] array = { 't', 'e', 's', 't' };
            Console.Write("char[] Output Test: ");
            Console.WriteLine(array);

            Console.Write("char[] Range Output Test: ");
            Console.WriteLine(array, 1, 2);
            array.Free();

            Console.WriteLine("New Line Output Test");
            Console.WriteLine();

            Console.Write("sbyte Output Test: Minimum: ");
            Console.Write(sbyte.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(sbyte.MaxValue);

            Console.Write("short Output Test: Minimum: ");
            Console.Write(short.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(short.MaxValue);

            Console.Write("int Output Test: Minimum: ");
            Console.Write(int.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(int.MaxValue);

            Console.Write("long Output Test: Minimum: ");
            Console.Write(long.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(long.MaxValue);

            Console.Write("\nbyte Output Test: Minimum: ");
            Console.Write(byte.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(byte.MaxValue);

            Console.Write("ushort Output Test: Minimum: ");
            Console.Write(ushort.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(ushort.MaxValue);

            Console.Write("uint Output Test: Minimum: ");
            Console.Write(uint.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(uint.MaxValue);

            Console.Write("ulong Output Test: Minimum: ");
            Console.Write(ulong.MinValue);
            Console.Write(", Maximum: ");
            Console.WriteLine(ulong.MaxValue);

            /*Console.Write("float Output Test: Test 1: ");
            //Console.Write(-3.40282347E+38f);
            Console.Write(3.14159E+4f);
            //Console.Write(3.40282347E+38);
            Console.Write(", Test 2: ");
            Console.Write(-9.999999f);
            Console.Write(", Test 3: ");
            Console.WriteLine(3.1f);*/

            Console.Write("\nbool Output Test: ");
            Console.Write(false);
            Console.Write(", ");
            Console.WriteLine(true);
        }

19 View Source File : GX2.cs
License : MIT License
Project Creator : KillzXGaming

private static uint ComputeSurfaceInfoEx()
        {
            uint tileMode = pIn.tileMode;
            uint bpp = pIn.bpp;
            uint numSamples = Math.Max(1, pIn.numSamples);
            uint pitch = pIn.width;
            uint height = pIn.height;
            uint numSlices = pIn.numSlices;
            uint mipLevel = pIn.mipLevel;
            Flags flags = new Flags();
            uint pPitchOut = pOut.pitch;
            uint pHeightOut = pOut.height;
            uint pNumSlicesOut = pOut.depth;
            uint pTileModeOut = pOut.tileMode;
            uint pSurfSize = (uint)pOut.surfSize;
            uint pBaseAlign = pOut.baseAlign;
            uint pPitchAlign = pOut.pitchAlign;
            uint pHeightAlign = pOut.heightAlign;
            uint pDepthAlign = pOut.depthAlign;
            uint padDims = 0;
            uint valid = 0;
            uint baseTileMode = tileMode;

            if (DebugSurface)
            {
                Console.WriteLine("---------------------------");
                Console.WriteLine(tileMode);
                Console.WriteLine(bpp);
                Console.WriteLine(numSamples);
                Console.WriteLine(pitch);
                Console.WriteLine(height);
                Console.WriteLine(numSlices);
                Console.WriteLine(mipLevel);
                Console.WriteLine(flags);
                Console.WriteLine(pPitchOut);
                Console.WriteLine(pHeightOut);
                Console.WriteLine(pNumSlicesOut);
                Console.WriteLine(pTileModeOut);
                Console.WriteLine(pSurfSize);
                Console.WriteLine(pBaseAlign);
                Console.WriteLine(pPitchAlign);
                Console.WriteLine(pHeightAlign);
                Console.WriteLine(pDepthAlign);
                Console.WriteLine(padDims);
                Console.WriteLine(valid);
                Console.WriteLine(baseTileMode);
                Console.WriteLine("---------------------------");
            }


            flags.value = pIn.flags.value;

            if ((((flags.value >> 4) & 1) != 0) && (mipLevel == 0))
                padDims = 2;

            if (((flags.value >> 6) & 1) != 0)
                tileMode = convertToNonBankSwappedMode((AddrTileMode)tileMode);
            else
            {
                if (DebugSurface)
                    Console.WriteLine(tileMode);

                tileMode = computeSurfaceMipLevelTileMode(
                tileMode,
                bpp,
                mipLevel,
                pitch,
                height,
                numSlices,
                numSamples,
                (flags.value >> 1) & 1, 0);

                if (DebugSurface)
                {
                    Console.WriteLine("---------------------------");
                    Console.WriteLine(tileMode);
                    Console.WriteLine("---------------------------");
                }
            }


            switch (tileMode)
            {
                case 0:
                case 1:
                    var compSurfInfoLinear = computeSurfaceInfoLinear(
                tileMode,
                bpp,
                numSamples,
                pitch,
                height,
                numSlices,
                mipLevel,
                padDims,
                flags);

                    valid = compSurfInfoLinear[0];
                    pPitchOut = compSurfInfoLinear[1];
                    pHeightOut = compSurfInfoLinear[2];
                    pNumSlicesOut = compSurfInfoLinear[3];
                    pSurfSize = compSurfInfoLinear[4];
                    pBaseAlign = compSurfInfoLinear[5];
                    pPitchAlign = compSurfInfoLinear[6];
                    pHeightAlign = compSurfInfoLinear[7];
                    pDepthAlign = compSurfInfoLinear[8];

                    pTileModeOut = tileMode;
                    break;
                case 2:
                case 3:
                    var compSurfInfoMicroTile = computeSurfaceInfoMicroTiled(
                tileMode,
                bpp,
                numSamples,
                pitch,
                height,
                numSlices,
                mipLevel,
                padDims,
                flags);

                    valid = compSurfInfoMicroTile[0];
                    pPitchOut = compSurfInfoMicroTile[1];
                    pHeightOut = compSurfInfoMicroTile[2];
                    pNumSlicesOut = compSurfInfoMicroTile[3];
                    pSurfSize = compSurfInfoMicroTile[4];
                    pTileModeOut = compSurfInfoMicroTile[5];
                    pBaseAlign = compSurfInfoMicroTile[6];
                    pPitchAlign = compSurfInfoMicroTile[7];
                    pHeightAlign = compSurfInfoMicroTile[8];
                    pDepthAlign = compSurfInfoMicroTile[9];

                    break;
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                    var compSurfInfoMacoTile = computeSurfaceInfoMacroTiled(
                tileMode,
                baseTileMode,
                bpp,
                numSamples,
                pitch,
                height,
                numSlices,
                mipLevel,
                padDims,
                flags);

                    valid = compSurfInfoMacoTile[0];
                    pPitchOut = compSurfInfoMacoTile[1];
                    pHeightOut = compSurfInfoMacoTile[2];
                    pNumSlicesOut = compSurfInfoMacoTile[3];
                    pSurfSize = compSurfInfoMacoTile[4];
                    pTileModeOut = compSurfInfoMacoTile[5];
                    pBaseAlign = compSurfInfoMacoTile[6];
                    pPitchAlign = compSurfInfoMacoTile[7];
                    pHeightAlign = compSurfInfoMacoTile[8];
                    pDepthAlign = compSurfInfoMacoTile[9];
                    break;
            }

            pOut.pitch = pPitchOut;
            pOut.height = pHeightOut;
            pOut.depth = pNumSlicesOut;
            pOut.tileMode = pTileModeOut;
            pOut.surfSize = pSurfSize;
            pOut.baseAlign = pBaseAlign;
            pOut.pitchAlign = pPitchAlign;
            pOut.heightAlign = pHeightAlign;
            pOut.depthAlign = pDepthAlign;

            if (DebugSurface)
            {
                Console.WriteLine(pOut.pitch);
                Console.WriteLine(pOut.height);
                Console.WriteLine(pOut.depth);
                Console.WriteLine(pOut.tileMode);
                Console.WriteLine(pOut.surfSize);
                Console.WriteLine(pOut.baseAlign);
                Console.WriteLine(pOut.pitchAlign);
                Console.WriteLine(pOut.heightAlign);
                Console.WriteLine(pOut.depthAlign);
            }


            if (valid == 0)
                return 3;

            return 0;
        }

19 View Source File : GX2.cs
License : MIT License
Project Creator : KillzXGaming

private static void computeSurfaceInfo(surfaceIn aSurfIn, surfaceOut pSurfOut)
        {
            if (DebugSurface)
            {
                Console.WriteLine(" computeSurfaceInfo ------------------------------------ ");

            }

            pIn = aSurfIn;
            pOut = pSurfOut;

            uint returnCode = 0;

            uint width, height, bpp, elemMode = 0;
            uint expandY, expandX;

            if (pIn.bpp > 0x80)
                returnCode = 3;

            if (DebugSurface)
                Console.WriteLine("returnCode " + returnCode);

            if (returnCode == 0)
            {
                if (DebugSurface)
                {
                    Console.WriteLine("-------------------------------------------");
                    Console.WriteLine(" computeMipLevel");
                    Console.WriteLine("-------------------------------------------");
                    Console.WriteLine(" pIn.width " + pIn.width);
                    Console.WriteLine(" pIn.height " + pIn.height);
                    Console.WriteLine(" pIn.numSlices " + pIn.numSlices);
                }

                computeMipLevel();

                width = pIn.width;
                height = pIn.height;
                bpp = pIn.bpp;
                expandX = 1;
                expandY = 1;

                if (DebugSurface)
                {
                    Console.WriteLine(pIn.width);
                    Console.WriteLine(pIn.height);
                    Console.WriteLine(pIn.numSlices);
                    Console.WriteLine("-------------------------------------------");
                }

                pOut.pixelBits = pIn.bpp;

                if (pIn.format != 0)
                {
                    bpp = formatExInfo[pIn.format * 4];
                    expandX = formatExInfo[pIn.format * 4 + 1];
                    expandY = formatExInfo[pIn.format * 4 + 2];
                    elemMode = formatExInfo[pIn.format * 4 + 3];

                    if (DebugSurface)
                    {
                        Console.WriteLine($"bpp {bpp}");
                        Console.WriteLine($"expandX {expandX}");
                        Console.WriteLine($"expandY {expandY}");
                        Console.WriteLine($"elemMode {elemMode}");
                    }


                    if (elemMode == 4 && expandX == 3 && pIn.tileMode == 1)
                        pIn.flags.value |= 0x200;

                    bpp = adjustSurfaceInfo(elemMode, expandX, expandY, bpp, width, height);

                    if (DebugSurface)
                    {
                        Console.WriteLine($"width {pIn.width}");
                        Console.WriteLine($"height {pIn.height}");
                        Console.WriteLine($"bpp {pIn.bpp}");
                    }
                }
                else if (pIn.bpp != 0)
                {
                    pIn.width = Math.Max(1, pIn.width);
                    pIn.height = Math.Max(1, pIn.height);
                }
                else
                    returnCode = 3;

                if (returnCode == 0)
                    returnCode = ComputeSurfaceInfoEx();

                if (returnCode == 0)
                {
                    pOut.bpp = pIn.bpp;
                    pOut.pixelPitch = pOut.pitch;
                    pOut.pixelHeight = pOut.height;

                    if (pIn.format != 0 && (((pIn.flags.value >> 9) & 1) == 0 || pIn.mipLevel == 0))
                        bpp = restoreSurfaceInfo(elemMode, expandX, expandY, bpp);

                    if (((pIn.flags.value >> 5) & 1) != 0)
                        pOut.sliceSize = (uint)pOut.surfSize;

                    else
                    {
                        pOut.sliceSize = (uint)(pOut.surfSize / pOut.depth);

                        if (pIn.slice == (pIn.numSlices - 1) && pIn.numSlices > 1)
                            pOut.sliceSize += pOut.sliceSize * (pOut.depth - pIn.numSlices);
                    }

                    pOut.pitchTileMax = (pOut.pitch >> 3) - 1;
                    pOut.heightTileMax = (pOut.height >> 3) - 1;
                    pOut.sliceTileMax = (pOut.height * pOut.pitch >> 6) - 1;
                }
            }
        }

19 View Source File : TexturePOWE.cs
License : GNU General Public License v3.0
Project Creator : KillzXGaming

public void Read(FileReader reader)
        {
            //Magic and ID not pointed to for sub entries so just skip them for now
            //     uint magic = reader.ReadUInt32();
            //   if (magic != Identifier)
            //         throw new Exception($"Invalid texture header magic! Expected {Identifier.ToString("x")}. Got {Identifier.ToString("x")}");
            //     ID = reader.ReadUInt32();

            CanReplace = true;
            CanRename = false;
            CanDelete = false;

            ID2 = reader.ReadUInt32();
            Width = reader.ReadUInt16();
            Height = reader.ReadUInt16();
            Unknown = reader.ReadUInt16();
            var numArray = reader.ReadByte();
            Unknown2 = reader.ReadByte();
            TexFormat = reader.ReadByte();
            Unknown3 = reader.ReadByte();
            Unknown4 = reader.ReadUInt16();

            Console.WriteLine(ID2);

            if (FormatTable.ContainsKey(TexFormat))
                Format = FormatTable[TexFormat];
            else
            {
                Format = TEX_FORMAT.ASTC_8x8_UNORM;
                Console.WriteLine("Unknown Format!" + TexFormat.ToString("X"));
            }

            MipCount = 1;
            ArrayCount = numArray;

            UpdateProperties();
        }

19 View Source File : SHARCFB.cs
License : GNU General Public License v3.0
Project Creator : KillzXGaming

public void Read(FileReader reader, uint Version)
        {
            var pos = reader.Position;
            uint SectionSize = reader.ReadUInt32();

            if (Version >= 13)
            {
                uint shaderVariableSize = reader.ReadUInt32();
                uint variationNameLength = reader.ReadUInt32();
                Name = reader.ReadString((int)variationNameLength);
                uint ValueSectionSize = reader.ReadUInt32();
                uint ValueCount = reader.ReadUInt32();

                for (int i = 0; i < ValueCount; i++)
                {
                    SharcNXValue value = new SharcNXValue();
                    value.Read(reader);
                    sharcNXValues.Add(value);
                }
            }
            else
            {
                uint shaderVariableSize = reader.ReadUInt32();
                uint variationNameLength = reader.ReadUInt32();
                uint symbolNameLength = reader.ReadUInt32();
                uint defaultValueLength = reader.ReadUInt32();
                uint variationCount = reader.ReadUInt32();

                Name = reader.ReadString((int)variationNameLength);
                SymbolName = reader.ReadString((int)symbolNameLength);
                DefaultValue = reader.ReadBytes((int)defaultValueLength);

                Console.WriteLine("----------------SHADER SYMBOL -----------");
                Console.WriteLine(SectionSize);
                Console.WriteLine(Name);
                Console.WriteLine(SymbolName);
                Console.WriteLine(DefaultValue);
                Console.WriteLine("-----------------------------------------");

                flags = new byte[variationCount];
                for (int i = 0; i < variationCount; i++)
                {
                    //  flags[i] = reader.ReadByte();

                    // flagData += " " + flags[i];
                }
            }

        
            reader.Seek(pos + SectionSize, System.IO.SeekOrigin.Begin);
        }

19 View Source File : LM2_DICT.cs
License : GNU General Public License v3.0
Project Creator : KillzXGaming

public void Load(System.IO.Stream stream)
        {
            modelFolder = new LM2_ModelFolder(this); 
            DrawableContainer.Name = FileName;
            Renderer = new LM2_Renderer();
            DrawableContainer.Drawables.Add(Renderer);

            Text = FileName;

            var HashNames = NLG_Common.HashNames;

            using (var reader = new FileReader(stream))
            {
                reader.ByteOrder = Syroot.BinaryData.ByteOrder.LittleEndian;
                uint Identifier = reader.ReadUInt32();
                ushort Unknown = reader.ReadUInt16(); //Could also be 2 bytes, not sure. Always 0x0401
                IsCompressed = reader.ReadByte() == 1;
                reader.ReadByte(); //Padding
                uint FileCount = reader.ReadUInt32();
                uint LargestCompressedFile = reader.ReadUInt32();
                reader.SeekBegin(0x2C);
                byte[] Unknowns = reader.ReadBytes((int)FileCount);

                TreeNode tableNodes = new TreeNode("File Section Entries");

                long FileTablePos = reader.Position;
                for (int i = 0; i < FileCount; i++)
                {
                    var file = new FileEntry(this);
                    file.Text = $"entry {i}";
                    file.Read(reader);
                    fileEntries.Add(file);
                    tableNodes.Nodes.Add(file);
                    
                    //The first file stores a chunk layout
                    //The second one seems to be a duplicate? 
                    if (i == 0) 
                    {
                        using (var tableReader = new FileReader(file.GetData()))
                        {
                            ChunkTable = new LM2_ChunkTable();
                            ChunkTable.Read(tableReader);

                            TreeNode debugFolder = new TreeNode("DEBUG TABLE INFO");
                            Nodes.Add(debugFolder);

                            TreeNode list1 = new TreeNode("Entry List 1");
                            TreeNode list2 = new TreeNode("Entry List 2 ");
                            debugFolder.Nodes.Add(tableNodes);
                            debugFolder.Nodes.Add(list1);
                            debugFolder.Nodes.Add(list2);
                            debugFolder.Nodes.Add(chunkFolder);
                            
                            foreach (var chunk in ChunkTable.ChunkEntries)
                            {
                                list1.Nodes.Add($"ChunkType {chunk.ChunkType} ChunkOffset {chunk.ChunkOffset}  Unknown1 {chunk.Unknown1}  ChunkSubCount {chunk.ChunkSubCount}  Unknown3 {chunk.Unknown3}");
                            }
                            foreach (var chunk in ChunkTable.ChunkSubEntries)
                            {
                                list2.Nodes.Add($"ChunkType {chunk.ChunkType} ChunkSize {chunk.ChunkSize} ChunkOffset {chunk.ChunkOffset}");
                            }
                        }
                    }
                }

                //Set an instance of our current data
                //Chunks are in order, so you build off of when an instance gets loaded
                TexturePOWE currentTexture = new TexturePOWE();
                LM2_Model currentModel = new LM2_Model(this);

                //Each part of the file is divided into multiple file/section entries
                //The first entry being the chunk table parsed before this
                //The second file being a duplicate (sometimes slightly larger than the first)
                //The third file stores texture headers, while the fourth one usually has the rest of the main data
                //Any additional ones currently are unknown how they work. Some of which have unknown compression aswell

                byte[] File002Data = fileEntries[2].GetData(); //Get the third file 
                byte[] File003Data = fileEntries[3].GetData(); //Get the fourth file

                List<uint> ModelHashes = new List<uint>();
                for (int i = 0; i < ChunkTable.ChunkEntries.Count; i++)
                {
                    if (ChunkTable.ChunkEntries[i].ChunkType == DataType.Model)
                    {
                 
                    }

                    using (var chunkReader = new FileReader(File002Data))
                    {
                        chunkReader.SeekBegin(ChunkTable.ChunkEntries[i].ChunkOffset);
                        uint magic = chunkReader.ReadUInt32();
                        uint hash = chunkReader.ReadUInt32();
                        ModelHashes.Add(hash);
                        Console.WriteLine($"{ChunkTable.ChunkEntries[i].ChunkType} {hash}");
                    }
                }

                int chunkId = 0;
                uint ImageHeaderIndex = 0;
                uint modelIndex = 0;
                uint messageIndex = 0;
                foreach (var chunk in ChunkTable.ChunkSubEntries)
                {
                    var chunkEntry = new ChunkDataEntry(this, chunk);
                    chunkEntry.Text = $"Chunk {chunk.ChunkType.ToString("X")} {chunk.ChunkType} {chunkId++}";
                    chunkEntries.Add(chunkEntry);
                    chunkFolder.Nodes.Add(chunkEntry);

                    if (chunk.BlockIndex == 0)
                        chunkEntry.DataFile = File002Data;
                    else if (chunk.BlockIndex == 1)
                        chunkEntry.DataFile = File003Data;

                    switch (chunk.ChunkType)
                    {
                        case SubDataType.TextureHeader:

                            //Read the info
                            using (var textureReader = new FileReader(chunkEntry.FileData))
                            {
                                currentTexture = new TexturePOWE();
                                currentTexture.ImageKey = "texture";
                                currentTexture.SelectedImageKey = currentTexture.ImageKey;
                                currentTexture.Index = ImageHeaderIndex;
                                currentTexture.Read(textureReader);
                                currentTexture.Text = $"Texture {ImageHeaderIndex}";
                                textureFolder.Nodes.Add(currentTexture);
                                Renderer.TextureList.Add(currentTexture);

                                Console.WriteLine(currentTexture.ID2);

                                ImageHeaderIndex++;
                            }
                            break;
                        case SubDataType.TextureData:
                            currentTexture.ImageData = chunkEntry.FileData;
                            break;
                        case SubDataType.MaterialData:
                            currentModel = new LM2_Model(this);
                            currentModel.ModelInfo = new LM2_ModelInfo();
                            currentModel.Text = $"Model {modelIndex}";
                            currentModel.ModelInfo.Data = chunkEntry.FileData;
                            modelFolder.Nodes.Add(currentModel);

                            if (ModelHashes.Count > modelIndex)
                            {
                                currentModel.Text = $"Model {modelIndex} {ModelHashes[(int)modelIndex].ToString("x")}";
                                if (HashNames.ContainsKey(ModelHashes[(int)modelIndex]))
                                    currentModel.Text = HashNames[ModelHashes[(int)modelIndex]];
                            }

                            modelIndex++;
                            break;
                        case SubDataType.ModelData:
                            uint numModels = chunk.ChunkSize / 16;
                            using (var dataReader = new FileReader(chunkEntry.FileData))
                            {
                                for (int i = 0; i < numModels; i++)
                                {
                                    uint hashID = dataReader.ReadUInt32();
                                    uint numMeshes = dataReader.ReadUInt32();
                                    dataReader.ReadUInt32(); 
                                    dataReader.ReadUInt32(); //0

                                    Console.WriteLine(hashID);

                                    string text = hashID.ToString("X");
                                    if (HashNames.ContainsKey(hashID))
                                        text = HashNames[hashID];

                                    if (i == 0)
                                        currentModel.Text = text;
                                }
                            }
                            break;
                        case SubDataType.MeshBuffers:
                            currentModel.BufferStart = chunkEntry.Entry.ChunkOffset;
                            currentModel.BufferSize = chunkEntry.Entry.ChunkSize;
                            break;
                        case SubDataType.BoneData:
                            if (chunk.ChunkSize > 0x40 && currentModel.Skeleton == null)
                            {
                                using (var boneReader = new FileReader(chunkEntry.FileData))
                                {
                                    currentModel.Skeleton = new STSkeleton();
                                    DrawableContainer.Drawables.Add(currentModel.Skeleton);

                                    uint numBones = chunk.ChunkSize / 68;
                                    for (int i = 0; i < numBones; i++)
                                    {
                                        boneReader.SeekBegin(i * 68);

                                        uint HashID = boneReader.ReadUInt32();
                                        boneReader.ReadUInt32(); //unk
                                        boneReader.ReadUInt32(); //unk
                                        boneReader.ReadUInt32(); //unk
                                        boneReader.ReadSingle(); //0
                                        var Scale = new OpenTK.Vector3(
                                           boneReader.ReadSingle(),
                                           boneReader.ReadSingle(),
                                           boneReader.ReadSingle());
                                        boneReader.ReadSingle(); //0
                                        var Rotate = new OpenTK.Vector3(
                                           boneReader.ReadSingle(),
                                           boneReader.ReadSingle(),
                                           boneReader.ReadSingle());
                                        boneReader.ReadSingle(); //0
                                        var Position = new OpenTK.Vector3(
                                            boneReader.ReadSingle(),
                                            boneReader.ReadSingle(),
                                            boneReader.ReadSingle());
                                        boneReader.ReadSingle(); //1

                                        STBone bone = new STBone(currentModel.Skeleton);
                                        bone.Text = HashID.ToString("X");
                                        if (NLG_Common.HashNames.ContainsKey(HashID))
                                            bone.Text = NLG_Common.HashNames[HashID];


                                        bone.Position = Position;
                                        bone.EulerRotation = Rotate;
                                        bone.Scale = new OpenTK.Vector3(0.2f, 0.2f, 0.2f);
                                        bone.RotationType = STBone.BoneRotationType.Euler;

                                        currentModel.Skeleton.bones.Add(bone);
                                    }

                                    currentModel.Skeleton.reset();
                                    currentModel.Skeleton.update();
                                }
                            }
                            break;
                        case SubDataType.VertexStartPointers:
                            using (var vtxPtrReader = new FileReader(chunkEntry.FileData))
                            {
                                while (!vtxPtrReader.EndOfStream)
                                    currentModel.VertexBufferPointers.Add(vtxPtrReader.ReadUInt32());
                            }
                            break;
                        case SubDataType.SubmeshInfo:
                            int MeshCount = chunkEntry.FileData.Length / 0x28;
                            using (var meshReader = new FileReader(chunkEntry.FileData))
                            {
                                for (uint i = 0; i < MeshCount; i++)
                                {
                                    LM2_Mesh mesh = new LM2_Mesh();
                                    mesh.Read(meshReader);
                                    currentModel.Meshes.Add(mesh);
                                }
                            }
                            currentModel.ModelInfo.Read(new FileReader(currentModel.ModelInfo.Data), currentModel.Meshes);
                            break;
                        case SubDataType.ModelTransform:
                            using (var transformReader = new FileReader(chunkEntry.FileData))
                            {
                                //This is possibly very wrong
                                //The data isn't always per mesh, but sometimes is
                                if (transformReader.BaseStream.Length / 0x40 == currentModel.Meshes.Count)
                                {
                                    for (int i = 0; i < currentModel.Meshes.Count; i++)
                                        currentModel.Meshes[i].Transform = transformReader.ReadMatrix4();
                                }
                            }
                            break;
                        case SubDataType.BoneHashes:
                            using (var chunkReader = new FileReader(chunkEntry.FileData))
                            {
                                while (chunkReader.Position <= chunkReader.BaseStream.Length - 4)
                                {
                                    uint hash = chunkReader.ReadUInt32();

                                    string strHash = hash.ToString("X");
                                    if (NLG_Common.HashNames.ContainsKey(hash))
                                        strHash = NLG_Common.HashNames[hash];
                                }
                            }
                            break;
                        case (SubDataType)0x7105:
                            using (var chunkReader = new FileReader(chunkEntry.FileData))
                            {
                            
                            }
                            break;
                        case SubDataType.MaterialName:
                            using (var matReader = new FileReader(chunkEntry.FileData))
                            {
                                string mat = matReader.ReadZeroTerminatedString();
                                materialNamesFolder.Nodes.Add(mat);
                            }
                            break;
                        case SubDataType.MessageData:
                            messageFolder.Nodes.Add(new NLOC_Wrapper($"Message Data {messageIndex++}",
                                new System.IO.MemoryStream(chunkEntry.FileData)));
                            break;
                        default:
                            break;
                    }
                }

                foreach (LM2_Model model in modelFolder.Nodes)
                {
                    model.ReadVertexBuffers();
                }

                if (messageFolder.Nodes.Count > 0)
                    Nodes.Add(messageFolder);

                if (modelFolder.Nodes.Count > 0)
                    Nodes.Add(modelFolder);

                if (textureFolder.Nodes.Count > 0)
                    Nodes.Add(textureFolder);

                if (materialNamesFolder.Nodes.Count > 0)
                    Nodes.Add(materialNamesFolder);
            }
        }

19 View Source File : SystemConsole.cs
License : MIT License
Project Creator : lechu445

public void WriteLine(uint value)
      => Console.WriteLine(value);

19 View Source File : OpenVRHelper.cs
License : MIT License
Project Creator : m3gagluk

private static bool EnumerateDevices()
        {
            
            for (uint i = 0; i < OpenVR.k_unMaxTrackedDeviceCount; i++)
            {
                //ETrackedDeviceProperty.Prop_RegisteredDeviceType_String returns htc/vive_controllerLHR-XXXXXXX
                string path = GetTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_RegisteredDeviceType_String);
                if (path == null)
                    continue;
                Console.WriteLine(i);
                Console.WriteLine(path);
                path = "/devices/" + path;
                Console.WriteLine("Found device {0} with path {1}", i, path);
                ulong handle = 0;
                EVRInputError err = OpenVR.Input.GetInputSourceHandle(path, ref handle);
                if (err != EVRInputError.None)
                {
                    Console.WriteLine("OpenVR GetInputSourceHandle error: {0}", err);
                    return false;
                }
                DeviceHandles.Add(handle);
            }
            return true;
        }

19 View Source File : Unsigned.cs
License : MIT License
Project Creator : maniero

public static void Main() {
		var x = 0u;
		System.Console.WriteLine(x - 1);
	}

19 View Source File : Program.cs
License : GNU General Public License v3.0
Project Creator : martinmladenov

static void Main(string[] args)
        {
            sbyte i1 = sbyte.Parse(Console.ReadLine());
            byte i2 = byte.Parse(Console.ReadLine());
            short i3 = short.Parse(Console.ReadLine());
            ushort i4 = ushort.Parse(Console.ReadLine());
            uint i5 = uint.Parse(Console.ReadLine());
            int i6 = int.Parse(Console.ReadLine());
            long i7 = long.Parse(Console.ReadLine());

            Console.WriteLine(i1);
            Console.WriteLine(i2);
            Console.WriteLine(i3);
            Console.WriteLine(i4);
            Console.WriteLine(i5);
            Console.WriteLine(i6);
            Console.WriteLine(i7);

        }

19 View Source File : Program.cs
License : GNU General Public License v3.0
Project Creator : martinmladenov

static void Main(string[] args)
        {
            string type = Console.ReadLine();
            switch (type)
            {
                case "int":
                    Console.WriteLine(int.MaxValue);
                    Console.WriteLine(int.MinValue);
                    break;
                case "uint":
                    Console.WriteLine(uint.MaxValue);
                    Console.WriteLine(uint.MinValue);
                    break;
                case "long":
                    Console.WriteLine(long.MaxValue);
                    Console.WriteLine(long.MinValue);
                    break;
                case "byte":
                    Console.WriteLine(byte.MaxValue);
                    Console.WriteLine(byte.MinValue);
                    break;
                case "sbyte":
                    Console.WriteLine(sbyte.MaxValue);
                    Console.WriteLine(sbyte.MinValue);
                    break;
            }
        }

19 View Source File : SoundBank.cs
License : GNU General Public License v3.0
Project Creator : Scobalula

private static object ConvertPCK(BinaryReader reader)
        {
            // Skip name and header
            reader.BaseStream.Position = 32;
            var nameSize = reader.ReadInt64();

            var name = reader.ReadUTF16NullTerminatedString();

            var entries = reader.ReadInt32();

            Directory.CreateDirectory("Files");

            reader.BaseStream.Position = 40 + nameSize;

            var tableOffset = 40 + nameSize;

            for (int i = 0; i < entries; i++)
            {
                reader.BaseStream.Position = tableOffset + i * 20;

                var entryID = reader.ReadUInt32();
                var unk = reader.ReadUInt32();
                var size = reader.ReadInt32();
                var offset = reader.ReadInt64();

                reader.BaseStream.Position = offset;

                Console.WriteLine(entryID);

                File.WriteAllBytes("Files\\" + entryID.ToString("X") + ".wav", reader.ReadBytes(size));
            }
            return null;
        }

19 View Source File : TestConvert.cs
License : MIT License
Project Creator : spaceflint7

void TestByte()
        {
            byte b = 255;
            Console.Write(b); Console.Write("\t"); Console.WriteLine(m_byteValue);
            Console.Write(m_int32Value); Console.Write("\t"); Console.WriteLine(m_uint32Value);
        }

19 View Source File : Program.cs
License : MIT License
Project Creator : Tuscann

static void Main()
    {
        sbyte num1 = -100;
        byte num2 = 128;
        short num3 = -3540;
        ushort num4 = 64876;
        uint num5 = 2147483648;
        int num6 = -1141583228;
        long num7 = -1223372036854775808;

        Console.WriteLine(num1);
        Console.WriteLine(num2);
        Console.WriteLine(num3);
        Console.WriteLine(num4);
        Console.WriteLine(num5);
        Console.WriteLine(num6);
        Console.WriteLine(num7);
    }

19 View Source File : Program.cs
License : MIT License
Project Creator : VanHakobyan

static void Main(string[] args)
        {
            var bin = 0b110_0000_0001_1001;
            var s = bin.ToString();
            Console.WriteLine(s);
            Console.ReadKey();

            uint x = 7;
            uint y = (x << 31);
            uint z = y >> 31;

            Console.WriteLine(x);
            Console.WriteLine(y);
            Console.WriteLine(z);
            //--------------------------

            //1-7 , 2 6,7

            char weekDay = Convert.ToChar(Console.ReadKey().KeyChar);//week day
            Console.WriteLine();


            //bad practice 

            //if (char.IsDigit(weekDay))
            //{
            //    if (weekDay != 2)
            //    {
            //        if (weekDay != 6)
            //        {
            //            if (weekDay != 7)
            //            {
            //                Console.WriteLine("arrived");
            //            }
            //        }
            //    }
            //}

            if (char.IsDigit(weekDay))
            {
                //int weekDayInt = Convert.ToInt32($"{weekDay}");

                if (weekDay == '2' || weekDay == '6' || weekDay == '7')
                {
                    Console.WriteLine("not arrived");
                }
                else
                {
                    Console.WriteLine("arrived");
                }
            }
            else
            {
                Console.WriteLine("Is not digit !!!");
            }
        }