Skip to content

Instantly share code, notes, and snippets.

View oupo's full-sized avatar

oupo oupo

  • Japan
View GitHub Profile
@oupo
oupo / desmume-stacktrace.diff
Created June 5, 2010 12:37
DeSmuME スタックトレース その2
diff -up src-orig/arm_instructions.cpp src/arm_instructions.cpp
--- src-orig/arm_instructions.cpp 2010-04-18 02:11:20.000000000 +0900
+++ src/arm_instructions.cpp 2010-06-04 18:45:54.625000000 +0900
@@ -6376,6 +6376,12 @@ TEMPLATE static u32 FASTCALL OP_STMDB_W
u32 c = 0, b;
u32 start = cpu->R[REG_POS(i,16)];
+#ifdef HAVE_LUA
+ if (REG_POS(i,16) == 13 && BIT_N(i, 14) && PROCNUM == 0) {
+ CallRegisteredLuaFunctions(LUACALL_ENTERFUNCTION);
@oupo
oupo / desmume-stacktrace.diff
Created May 30, 2010 09:31
DeSmuME スタックトレース その1
diff -up src-orig/NDSSystem.cpp src/NDSSystem.cpp
--- src-orig/NDSSystem.cpp 2010-04-21 02:16:36.000000000 +0900
+++ src/NDSSystem.cpp 2010-05-30 14:23:55.281250000 +0900
@@ -2361,6 +2361,10 @@ void NDS_Reset()
memcpy(FW_Mac, (MMU.fw.data + 0x36), 6);
initSchedule();
+
+ call_stack[0].clear();
+ call_stack[1].clear();
@oupo
oupo / myutil.lua
Created June 15, 2010 10:50
myutil.lua
function reg(i) return memory.getregister("r"..i) end
read8 = memory.readbyte
read32 = memory.readdword
read16 = memory.readword
function read16_noalign(addr)
return bit.bor(read8(addr), bit.lshift(read8(addr+1), 8))
end
function read32_noalign(addr)
return bit.bor(read16_noalign(addr), bit.lshift(read16_noalign(addr+2), 16))
end

テクニック値の計算

間違っている可能性が多分にあります

計算に使われる定数

近くの選手の値への倍率5
ダブルのときの補正20 トリプルのときの補正40

ジョインアベニューくじ引き屋の乱数調整実践

理論的なことはこっち

まず以下のことを前提とする。

  • DSのねじを外せないため初期化ができない
  • 秘書宅に動くNPCがいない程度にアベニューランクは低い (この前提が満たされない場合については後述する)
using System;
namespace shake_balls
{
class ShakeBalls
{
static void Main(string[] args)
{
int[] search = { 1, 4, 2, 4, 1, 2, 4, 1, 2, 4, 2, 1, 4, 1, 2, 4, 3, 4, 1, 2, 4, 3, 4, 2, 1, 4, 2, 1, 4, 2, 1, 2, 4, 1 };
for (UInt64 s = 0; s < (1 << 19); s++)
#include <fat.h>
#include <nds.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
// https://github.com/nayuki/QR-Code-generator
#include "BitBuffer.hpp"
#include "QrCode.hpp"
@oupo
oupo / build.sh
Last active January 3, 2020 10:36
togasat-wasm
emcc -std=c++11 main.cpp -O3 -s WASM=1 -s MODULARIZE=1 -s EXPORT_NAME=Togasat -s "EXPORTED_FUNCTIONS=['_solve', '_malloc', '_free']" -s "BINARYEN_METHOD='native-wasm'" -o togasat.js

トーナメント

ランクの決定

  • チームレベルからランクへ
  • (チーム内での最大レベル - チームレベル)が10以上ならランクから2を引く
  • ランクプラスの条件にマッチしたらランクをその分あげる (複数のランクプラスの条件にマッチしても適用されるのは一番高いもののみ)
  • 調整
    • ランクが16のとき: ランクを14~16からランダム
    • ランクが15のとき: ランクを13~15からランダム
#include <iostream>
#include <random>
#include <cstdint>
#include <chrono>
using namespace std;
#include <easy-ip.h>
typedef int64_t s64;
typedef uint64_t u64;
typedef __int128 s128;