All possible C# keywords

I was bored waiting for lightbaking to complete, so I created a C# file.
The goal is to use every single possible keyword, not re-using keywords unless required, and using the least amount of lines of code.
Here my solution. It compiles but I have no clue what it does. I would not recommend running it:

using UnityEngine;
namespace A{}
class F{}
 abstract class test : MonoBehaviour{
   struct k{}
   abstract public void J();
   interface B{}
   public virtual void E(ref ulong v){}
   sealed protected class I : System.Exception{
     public static explicit operator I(float b){return null;}
     public static implicit operator int(I i){return sizeof(bool);}
     internal delegate void H();
     event H h;
     volatile object B = typeof(I);
     readonly int t;
     const byte d = unchecked(checked(0));
     private enum G:long{};
      void S (out decimal z,  params object[] q) {
       F e = new F() as F;
     i:if(q is I)do throw this;while(false);else for(;true;)continue;
       try{foreach(char u in new short[(ushort)(byte)0])switch(d){case 0:break;
     default:goto i;}}catch (I g){}finally{lock(q);}}}
}
class B : test{
   public override void J(){}
}

I decided to to this because I happened to run across this on the internet:

It is a serious contest to create the code which is the most UN-readible and confusing. The winners get prizes and awards.

3 Likes

I’m also bored. You forgot these:

from
select
where
as
ushort
byte
3 Likes

updated to include “as, ushort, byte”. I’m sure the “as” keyword could be used better to provide shorter code.
(the from, to, where) are not the primary keywords, so I didn’t use them.

There’s other keywords, but Unity complains when I use them (“internal”, “stackalloc”, etc.).
Anyways the light baking is done, so I have to get back to that now.

Also missed:

namespace
unsafe (not really supported in unity, you need to force enable it)
fixed
lock
using
catch
finally
goto
base
default
extern (… king of supported, but would be platform specific)
struct
override

and nearly all of the linq keywords

1 Like

@lordofduct
namespace is already at the top.
using is also at the top.
LINQ keywords do not count. @ArachnidAnimal made a point on that.
goto and default are already used.
catch and finally are already used.

EDIT:

@ArachnidAnimal 's edit is 2 minutes before your post, so I assumed @lordofduct , you are referencing an older post. Sorry, retracting my claims.

1 Like

Just added struct and override . Thanks.
Allready used the others, except for base
Couldnt figure out how to use the following in Unity: fixed , extern ,unsafe ,stackalloc. So i just ignored them. Maybe there’s a way.
2348116--158932--keywords.png

dynamic?

:stuck_out_tongue: