Initializing a Huge Array
Is there a better/more efficient way to initialize a large array that is all one value? Help heightMap[new Vector2Int(x, z)] = new sbyte[16, 16] { { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, { -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128 }, };
A programming screenshot asks whether there is a more efficient way to initialize a large 16×16 sbyte array when every element should be -128. The joke is that the poster manually writes the same value over and over, creating an absurdly long and inefficient initialization. EN: A programming screenshot asks whether there is a more efficient way to initialize a large 16×16 sbyte array when every element should be -128. The joke is that the poster manually writes the same value over and over, creating an absurdly long and inefficient initialization.
code editor screenshot / скриншот редактора кодаarray / массивprogramming code / программный кодrepeated numbers / повторяющиеся числаcomputer screen / экран компьютераtext / текстbraces / фигурные скобкиinteger values / целочисленные значенияgrid of values / сетка значенийwhite background / белый фон
- @gentoomemes / 8396 2024-01-01
- Type
- image
- Size
- 700×367 · 76.1 KiB
- Mood
- саркастичный, абсурдный
- Language
- en
- Added