4 ms·
some pleasant tree patterns: 0000000000000000000000000000000011111111111111111111111111111111 0000000000000000111111111111111111111111111111110000000000000
by kilovoltaire 11y ago
some pleasant tree patterns:
0000000000000000000000000000000011111111111111111111111111111111
0000000000000000111111111111111111111111111111110000000000000000
0000000011111111111111110000000000000000111111111111111100000000
0000111111110000000011111111000000001111111100000000111111110000
0011110000111100001111000011110000111100001111000011110000111100
0110011001100110011001100110011001100110011001100110011001100110
(the first 64 gray codes, as columns)
- m1el 11y agopython code to generate this thing: def graytree(n): for row in range(n, 0, -1): d = 2**(row-1) yield ''.join(str(((i+d)>>row)%2) for i in range(2**n)) for r in graytree(6): print(r)
- acc54321 11y agoor in J graycodes=: verb define >(0&,&.>,1&,&.>@:|.)^:(<:y) 0 1 ) ' +'{~|:graycodes 6 ++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++ ++++++++++++++++ ++++++++++++++++ ++++++++ ++++++++ ++++++++ ++++++++ ++++ ++++ ++++ ++++ ++++ ++++ ++++ ++++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++