Skip to content

Instantly share code, notes, and snippets.

PurpleWavelet (Protoss)
#include<BWAPI.h>
#include<cmath>
#define A auto
#define C continue;
#define G using
#define N G namespace
#define R return
#define PP Position
Me:
Write a StarCraft bot in C++, which replaces ExampleAIModule.dll. The bot should rush the opponent with workers, and use mineral walking to stack workers as they attack the enemy.
ChatGPT:
Here is an example of a simple StarCraft bot written in C++ that rushes the opponent with workers and uses mineral walking to stack workers as they attack the enemy:
#include "ExampleAIModule.h"
using namespace BWAPI;
void ExampleAIModule::onStart()
@dgant
dgant / backupProject.sh
Created June 12, 2023 20:53
Script to create a datestamped backup of your project
#!/bin/bash
src_dir="/c/MyProject"
base_tgt_dir="/d/MyProjectBackups"
current_date=$(date +"%Y-%m-%d")
tgt_dir="${base_tgt_dir}/${current_date}"
# If the target directory already exists, delete it first
if [ -d "$tgt_dir" ]; then
rm -rf "$tgt_dir"
import math
import random
import numpy as np
import sounddevice as sd
from PIL import Image, ImageDraw
def distance(x, y):
return (x**2 + y**2) ** 0.5
def generate_image(id):