Skip to content

Instantly share code, notes, and snippets.

@sakapon
Last active September 2, 2020 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapon/06d170b712990531022ed577ba051a37 to your computer and use it in GitHub Desktop.
Save sakapon/06d170b712990531022ed577ba051a37 to your computer and use it in GitHub Desktop.
OperatorsSample/BitArrayTest.BitSearch
[TestMethod]
public void BitSearch()
{
var n = 8;
var n2 = 1 << n; // 256
// bit 全探索
for (BitArray b = 0; b.Value < n2; b++)
{
for (int i = 0; i < n; i++)
{
// b[i] の真偽による何らかの処理
Console.Write(b[i] ? 1 : 0);
}
Console.WriteLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment