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
for (int i = 0; i < spawnedFish.size(); i++) { | |
IND_Entity2d * fish = spawnedFish.at(i); | |
for (int j = 0; j < 20; j++) { | |
if ((x - j) == fish->getPosX()) { | |
x -= 10; | |
} | |
else if ((x + j) == fish->getPosX()) { | |
x += 10; | |
} | |
} |
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 main(...) | |
{ | |
srand(time(NULL)); | |
while (true) { | |
int nmin = 220; | |
int nmax = 550; | |
int x = nmin + (std::rand() % (nmax - nmin + 1)); | |
printf("%i\n", x); | |
} | |
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
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: Basic apps I use | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: Best web browser IMO | |
cinst GoogleChrome | |
:: For calling/contacting people | |
cinst Skype |
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
template <typename T, size_t N> | |
char (&ArraySizeHelper(T (&array)[N]))[N]; | |
#define arysize(array) (sizeof(ArraySizeHelper(array))) |
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 <cstdio> | |
#include <string> | |
#include <cstring> | |
#include <cstdlib> | |
#include "zlib.h" | |
#include "zconf.h" | |
using namespace std; | |
bool gzipInflate( const std::string& compressedBytes, std::string& uncompressedBytes ) { | |
if ( compressedBytes.size() == 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
#include <stdio.h> | |
#include <string.h> | |
#include <zlib.h> | |
int main() | |
{ | |
const char * dat = "Hello world!"; | |
gzFile * f = (gzFile *)gzopen("archive.gz", "wb"); | |
gzwrite(f, dat, strlen(dat)); | |
gzclose(f); |
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 <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <string> | |
#include <zlib.h> | |
#include <zconf.h> | |
using namespace std; | |
void compress(string filename, string data) | |
{ |
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
(Get-Command exe).Path |
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
#!/usr/bin/env python | |
# This Python script allows you to create tiny custom Waf distributions | |
# for each project you have. It's very similar to Gradle's wrapper scripts. | |
# Your mini Waf distribution can be customized using the variables at the top | |
# of the script. | |
from __future__ import print_function | |
import os | |
import sys |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import sys | |
def make_speech_bubble(message): | |
def times_msg_size(string): return (string * len(message)) | |
print(' _' + times_msg_size('_') + '_') | |
print('/ ' + times_msg_size(' ') + ' \\') | |
print('| ' + message + ' |') | |
print('\\_' + times_msg_size('_') + '_/') |