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
import itertools as it | |
def read_little_endian_word(xs): | |
result = 0 | |
for x in reversed(xs): | |
result <<= 8 | |
result += x | |
return result | |
def read_pointer(xs): |
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
PUSH | |
// DifficultySelect_Init | |
// - proc->unk_30 = 0 | |
// + proc->unk_30 = 1 | |
// | |
// Change the initial state of the difficulty select proc to Normal mode. | |
// | |
// TECHNICAL NOTES: | |
// The compiler actually optimized a 0-write to both unk_30 and unk_2c to use |
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
(* Heterogeneous ("universal") maps. | |
* | |
* Keys are represented as the type ['a Key.t], where the ['a] is the type of | |
* the value stored at that key. | |
*) | |
structure Univ_map : sig | |
structure Key : sig | |
type 'a t | |
val create : unit -> 'a t |
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
(* Submitter nickname: JCB *) | |
(* Submission begins HERE *) | |
(** | |
typedef struct stack_header stack_t; | |
struct stack_header { | |
list* top; | |
list* floor; | |
}; |
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
signature PRICES = | |
sig | |
datatype tix = OH | BC | SK | |
val price : tix -> int | |
end | |
signature CART = | |
sig |
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
(* Implementation of Conway's GOL with red/blue cells as specified by | |
* /r/dailyprogrammer's Intermediate challenge #315 | |
*) | |
structure Conway = | |
struct | |
(* this seed is fixed, because SML *sucks* and there's no way to get the | |
* system time that I could find. | |
*) |
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
CRIT_ST: | |
push {r3-r4, lr} | |
mov r2, r0 @ r0 = 0203A3F0, attacker | |
mov r3, r0 @ | |
add r2, #0x60 @ 0x60 = index of attacker hit | |
add r1, #0x62 @ 0x62 = index of defender avo | |
ldrh r2, [r2] @ load | |
ldrh r1, [r1] @ | |
sub r1, r2, r1 @ calc final hit | |
mov r2, r0 @ |
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
hitToCrit: | |
movs r3, #96 | |
push {r4, lr} | |
ldrh r4, [r0, r3] | |
adds r3, r3, #2 | |
ldrh r2, [r1, r3] | |
movs r3, #0 | |
cmp r4, r2 | |
bcc .L2 | |
subs r3, r4, r2 |
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
// Order to do stuff | |
ROMHack: text gfx events asm bin | |
// Commands | |
events: | |
assemble prologue_events | |
text: | |
inserttext prologue_1 | |
inserttext prologue_2 |
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/python | |
for _ in range(5): | |
s,*gs=[bin(i)[2:].zfill(3)for i in tuple(map(int,input().split(', ')))] | |
print('\t'.join(map(' '.join, (gs,[''.join((('rwsrwsrwt'[i*3:i*3+3])if int(s[::-1][i])else'rwx')[j]if int(g[j])else'-'for j in range(3))for i,g in enumerate(gs)])))) |
NewerOlder