Advertisement
Guest User

Brainf (C# Shell App Paste)

a guest
Oct 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Collections.Generic;
  6.  
  7. namespace CSharp_Shell
  8. {
  9.  
  10.     public static class Program
  11.     {
  12.         public static void Main()
  13.         {
  14.            var data = new Data();
  15.            Console.WriteLine(data);
  16.            data++;
  17.            Console.WriteLine(data);
  18.            data = data.Next;
  19.            Console.WriteLine(data);
  20.            data++;
  21.            Console.WriteLine(data);
  22.            
  23.         }
  24.        
  25.         class Data{
  26.        
  27.             public Data Next{
  28.                 get{
  29.                     if(_next == null)
  30.                         _next = new Data();
  31.                     _next._previous = this;
  32.                     return _next;
  33.                 }
  34.             }
  35.             public Data Previous{
  36.                 get{
  37.                     return _previous;
  38.                 }
  39.             }
  40.            
  41.             private Data _next;
  42.             private Data _previous;
  43.             private byte Value = 48;
  44.            
  45.             public static Data operator ++(Data data){
  46.                 data.Value++;
  47.                 return data;
  48.             }
  49.            
  50.             public static Data operator --(Data data){
  51.                 data.Value--;
  52.                 return data;
  53.             }
  54.            
  55.             override public string ToString(){
  56.                 return ((char)Value).ToString();
  57.             }
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement