Euphoria
drunken_bishop.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 
5 #include "core/table.h"
6 #include "base/ints.h"
7 
8 
9 namespace eu::core
10 {
11  // split hash to a msb->lsb array
12  std::vector<U8>
13  to_bytes(U32 hash);
14 
15  // split hash to a msb->lsb array
16  std::vector<U8>
17  to_bytes(U64 hash);
18 
19  // split to 2-bit ints
20  std::vector<int>
21  to_codes(U8 byte, bool msb_first);
22 
23  std::vector<int>
24  to_codes(const std::vector<U8>& bytes, bool msb_first);
25 
26  Table<int>
28  (
29  U32 hash,
30  int width,
31  int height,
32  bool msb_first = true,
33  int startx = -1,
34  int starty = -1
35  );
36 
37  Table<int>
39  (
40  U64 hash,
41  int width,
42  int height,
43  bool msb_first = true,
44  int startx = -1,
45  int starty = -1
46  );
47 
48  Table<int>
50  (
51  const std::vector<int>& codes,
52  int width,
53  int height,
54  int startx = -1,
55  int starty = -1
56  );
57 
58 
59  std::vector<std::string>
61 
62  std::vector<std::string>
64  (
65  const Table<int>& table,
66  const std::vector<std::string>& characters
67  );
68 
69  // todo(Gustav): add image collapse with palette
70 }
std::vector< std::string > render_table(const Table< int > &table, const std::vector< std::string > &characters)
Table< int > get_drunken_bishop_result(U32 hash, int width, int height, bool msb_first, int startx, int starty)
std::vector< int > to_codes(U8 byte, bool msb_first)
std::vector< U8 > to_bytes(U32 hash)
std::vector< std::string > get_ssh_characters()
std::uint32_t U32
Definition: ints.h:13
std::uint8_t U8
Definition: ints.h:15
std::uint64_t U64
Definition: ints.h:12