This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
using namespace std; | |
union Foo { | |
enum class Type { | |
INT, | |
FLOAT | |
}type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this checks the pseudo-distance from the edge of the screen | |
function CheckDistance(region): | |
//locations relative to the camera | |
x = region.x - camera.x | |
y = region.y - camera.y | |
//if the region is visible, return 0 | |
if (-pager.w < x < screen.w) return 0 | |
if (-pager.h < y < screen.h) return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 20 30 40 50 60 70 80 90 100 | |
10 20 61 85 145 169 199 227 301 340 369 | |
20 10 56 92 122 148 164 195 250 266 298 | |
30 7 37 63 91 122 171 219 255 300 337 | |
40 1 30 61 92 111 178 222 268 280 296 | |
50 1 21 65 105 125 137 190 209 296 275 | |
60 1 12 54 94 119 138 165 198 285 244 | |
70 1 1 34 47 78 163 154 187 247 293 | |
80 1 1 17 44 102 122 157 232 254 232 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ ---------------------------------------------------------------------------- + | |
| TODOS @ Sunday 20 April 2014 01:41 | | |
| 124 files scanned | | |
+ ---------------------------------------------------------------------------- + | |
## NOTE (4) | |
1. region_pager.hpp:53 don't change the sizes mid-program, it will cause issues | |
2. raster_font.cpp:43 This class can only take a raster font with 16*16 characters, and the | |
3. server_application.cpp:109 I might need to rearrange the init process so that lua & SQL can interact | |
4. server_application.cpp:300 assigning each field one-by-one so adding or moving a field doesn't break this code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/common/network/serial.cpp b/common/network/serial.cpp | |
index 2aa88cb..5130841 100644 | |
--- a/common/network/serial.cpp | |
+++ b/common/network/serial.cpp | |
@@ -21,7 +21,7 @@ | |
*/ | |
#include "serial.hpp" | |
-#include "map_generator.hpp" | |
+#include "map_allocator.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "sqlite3/sqlite3.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
const char* command = "CREATE TABLE accounts(username VARCHAR(100)); INSERT INTO accounts VALUES(\"Ratstail91\"); SELECT * FROM accounts;"; | |
int main(int argc, char* argv[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check for collisions | |
for (int i = -6; i < 6; ++i) { | |
for (int j = -6; j < 6; ++j) { | |
Vector2 wallPoint = { | |
snapToBase(32.0, character.GetOrigin().x), | |
snapToBase(32.0, character.GetOrigin().y) | |
}; | |
wallPoint.x += i * 32; | |
wallPoint.y += j * 32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Rules | |
* Write the implementation in Container.h, do not change ContainerTest.cpp. | |
* No memory allocation is allowed (implicit or explicit). | |
* Use of the STL (Standard Template Library) is not allowed. | |
* You can add member functions and variables. | |
* All storage management data structures must use the buffer memory, not additional member variables. | |
* You must test your solution in debug (or any configuration that have asserts enabled) so that the requirements are tested. | |
* Your solution must be efficient and scalable. | |
* Try to maximize the number of elements in the given buffer, and also perform well whether you have ten elements or thousands. | |
* Optionally, you can uncomment the _ADVANCED macro at the top of ContainerTest.cpp and implement the sorting algorithm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned hashuint(unsigned x) { | |
//found this on stack overflow | |
x = ((x >> 16) ^ x) * 0x45d9f3b; | |
x = ((x >> 16) ^ x) * 0x45d9f3b; | |
x = ((x >> 16) ^ x); | |
return x; | |
} | |
unsigned hashCoordinates(unsigned seed, int x, int y) { | |
//default values when 0 is a parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int CompareOddEven(int lhs, int rhs) | |
{ | |
//lhs < rhs ? -1, 1, 0 | |
//odd vs even | |
if (lhs % 2 == 1 && rhs % 2 == 0) { | |
return -1; | |
} | |
if (lhs % 2 == 0 && rhs % 2 == 1) { | |
return 1; |
OlderNewer