{{ message }}

Instantly share code, notes, and snippets.

# Jahyun Oh soharu

Created Feb 11, 2014
명령행 인자를 출력하는 MMIX 코드
View args.mms
 argv IS \$1 t IS \$255 k GREG 0 LOC Data_Segment GREG @ NewLn BYTE #a,0 LOC #100 Main SET k,0 Loop LDOU t,argv,k BZ t,Term
Last active Aug 29, 2015
레지스터 \$0에 저장된 명령행 인자 갯수를 이용한 명령행 인자 출력
View args2.mms
 cnt IS \$0 argv IS \$1 t IS \$255 k GREG 0 LOC Data_Segment GREG @ NewLn BYTE #a,0 LOC #100 Main SET k,0 Loop LDOU t,argv,k
Created Mar 24, 2014
Print table of 500 primes
View gist:9740439
 % Algorithm P: Print table of 500 primes L IS 500 % The number of primes to find t IS \$255 % Temporary storage n GREG 0 % Prime candidate q GREG 0 % Quotient r GREG 0 % Remainder jj GREG 0 % Index for PRIME[j] kk GREG 0 % Index for PRIME[k] pk GREG 0 % Value of PRIME[k] mm IS kk % Index for output lines
Created Mar 25, 2014
TAOCP 1.3.2 Exercise 5: silly
View gist:9760239
 LOC #100 Main GETA \$255,Silly TRAP 0,Fputs,StdOut TRAP 0,Halt,0 Silly BYTE 3+"pills"+6 % 3+'p','i','l','l','s'+6
Created Jun 10, 2014
IPSC 2014 A
 var input = [], s2n = function (s) { return parseInt(s, 10) }, solve = function (r, c, candy_box) { var result = 0; for (var i = 0; i < r; i += 1) { for (var j = 0; j < c; j += 1) { if (candy_box[i][j] !== 'o') continue; if (j > 0 && j < c - 1 && candy_box[i][j - 1] === '>' && candy_box[i][j + 1] === '<') { result += 1;
Created Jun 18, 2014
IPSC 2014 B1
View gist:3d8abd49e217076aa343
 #!/usr/bin/env python import unittest import os import sys r, s, m = 43, 22, 2**32 X = [] def setup(xs):
Last active Dec 13, 2015 — forked from falsetru/submit.py
View submit.py
 #!/usr/bin/env python import urllib, urllib2 import cookielib import os from contextlib import closing import re import getpass import webbrowser import sys
Last active Dec 14, 2015
va_list in Cocoa
View gist:5096919
 - (void)setContentsWithFormat:(NSString *)formatString, ... { [contents autorelease]; va_list args; va_start(args, formatString); contents = [[NSString alloc] initWithFormat:formatString arguments:args]; va_end(args); }
Created Aug 27, 2013
View suffix_array.cpp
 // Suffix Array from JMBook // // #include #include #include #include using namespace std;
Last active Jan 2, 2016