Skip to content

Instantly share code, notes, and snippets.

View oupo's full-sized avatar

oupo oupo

  • Japan
View GitHub Profile
#include <iostream>
#include <cstdio>
#include <cstdint>
#include <ctime>
#include <vector>
#include "PokeRNG/Calc5GenSeed.hpp"
#include "PokeRNG/CalcOffset.hpp"
using namespace std;
107: 29.956348057886107
134: 1521.3506253105813
137: 30.205783417645335
165: 1172.7989723282597
298: 2113.0381097268137
328: 15.126308900915555
333: 1510.5152393835276
358: 956.7651621386631
ENOENT: no such file or directory, open 'sounds/382.wav'
471: 899.1041997657696
#include <iostream>
#include <cstdint>
#include <vector>
#include <omp.h>
using namespace std;
typedef uint32_t u32;
typedef int64_t s64;
// run this in factory-search.html
data = factory_data.slice(1, 1 + 150)
data.sort((x, y) => x.pokemon.stats.reduce((a,b)=>a+b, 0) - y.pokemon.stats.reduce((a,b)=>a+b, 0))
table = data.map(x => {return "<tr><td>" + x.id + "<td>" + x.name + "<td>" + x.item + "<td>" + x.move.join(" ") +
"<td>" + x.pokemon.abilities[0] + "<td>" + (x.pokemon.abilities[0] == x.pokemon.abilities[1] ? "-" : x.pokemon.abilities[1]) +
"<td>" + x.pokemon.stats.reduce((x,y)=>x+y, 0) + "<td>" + get_status(trainer_rank(false, 1), x)[5]}).join("")
document.body.innerHTML = "<h2>rank 1</h2><table>" + table +"</table>"
# Pt, HGSSでのフロンティアのきのみスクラッチ
class LCG
def initialize(seed)
@seed = seed
end
def clone
LCG.new(@seed)
end
@oupo
oupo / nitrodis.rb
Last active November 19, 2017 14:50
# NDSファイルの中のoverlayたちを展開して逆アセンブルする
# Usage: ruby nitrodis.rb <filename>.nds
require "fileutils"
OBJDUMP = 'C:/devkitPro/devkitARM/bin/arm-none-eabi-objdump.exe'
SIZEOF_OVR = 32
diff --git a/desmume/src/frontend/windows/fsnitroView.cpp b/desmume/src/frontend/windows/fsnitroView.cpp
index b12147a..939aef2 100644
--- a/desmume/src/frontend/windows/fsnitroView.cpp
+++ b/desmume/src/frontend/windows/fsnitroView.cpp
@@ -168,12 +168,19 @@ BOOL CALLBACK ViewFSNitroProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
item.item.lParam = 0xFFFE;
HTREEITEM hOverlay = TreeView_InsertItem(tree, &item);
+ std::vector<std::string> dirPaths;
+ dirPaths.resize(numDirs + 1);
require "socket"
HOST = "localhost"
PORT = 55555
def main
sock = TCPSocket.open(HOST, PORT)
sock.write("+")
sock.write(make_msg("g"))
while (str = read_msg(sock)) != "+"
#include <cstdio>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <chrono>
#include <random>
typedef int64_t s64;
typedef uint64_t u64;
typedef __int128 s128;
require "socket"
sock = TCPSocket.open("localhost", 1234)
def sum(str)
str.bytes.inject(0, :+) % 256
end
def make_msg(str)
"$" + str + "#" + sum(str).to_s(16)