Blizzardo1 icon

Unsafe Random Rise Run Program

Blizzardo1 | PRO | 09/28/13 11:37:11 PM UTC | 0 ⭐ | 699 👁️ | Never ⏰ | []
C# |

840 B

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Console
{
    class Program
    {
        static unsafe void Main(string[] args)
        {
            double* x = stackalloc double[10];
            double* y = stackalloc double[10];
            double* m = stackalloc double[10];
            double* b = stackalloc double[10];
            
            for (int i = 0; i < 10; i++)
            {
                b[i] = Next();
                m[i] = Next();
                x[i] = Next();
                y[i] = (m[i] * x[i]) + b[i];
                Console.WriteLine("Rise (y) = {0}, Run (x) = {1}", y[i], x[i]);
            }
            Console.ReadKey(true);
        }
 
        static unsafe int Next()
        {
            return (new Random()).Next(0, 32);
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎