Skip to content

Instantly share code, notes, and snippets.

@yutopp
yutopp / hsp_d_1.hsp
Created January 20, 2012 09:37
なぜ動く?(HSP3.3)
ho : stop
#deffunc ho int s, 5
@yutopp
yutopp / hsp_d_2.hsp
Created January 20, 2012 09:43
カオス・・・
ho
#deffunc ho "ちくわむしゃむしゃHSP!
mes "エンダァァ
@yutopp
yutopp / あだぷた
Created February 1, 2012 05:08
Range AdaptorみたいなものをDartで実装しようとしてナムサン
//----- Iterators -----
//referencable
interface ReferencableIterator<E> {
clone();
E reference();
/*operator equals*/
bool operator==( it );
}
//forward
class ho
{
const ho();
number() => 5;
}
class hoge {
static homu() => _i.number();
static final _i = const ho();
}
class parent
{
homu() => child.o();
var child;
}
class child extends parent
{
child() { super.child = this; }
o() => print( "o" );
@yutopp
yutopp / urlEncode
Created March 23, 2012 04:39
ぐぬぬ
#import("dart:utf",prefix:"utf");
class Url {
static String encodeUtf8( final String src ) => _encode( src, (s)=>utf.encodeUtf8(s) );
static String _encode( final String rawSrc, List f(final String) )
=> new String.fromCharCodes( ( final List src, List dst ) {
src.forEach(
(c) =>
dst.addAll(
#include <iostream>
#include <Windows.h>
int main() {
typedef unsigned char byte_t;
byte_t* const p = reinterpret_cast<byte_t*>( ::VirtualAlloc( NULL, 1024, MEM_COMMIT, PAGE_EXECUTE_READWRITE ) );
if ( p == NULL )
return -1;
@yutopp
yutopp / gist:2329130
Created April 7, 2012 13:55
ぐぬぬ
#include "include/code_stub.hpp"
#include "include/assembler.hpp"
#include <iostream>
int main() {
ytd::assembler::code_stub code( 2048 );
namespace x86 = ytd::assembler::ia_32;
using namespace x86::registers;
@yutopp
yutopp / yt_asm
Created May 24, 2012 17:29
こんなインターフェースにしたのは誰だ?
#include <vector>
#include <ytl/assembler.hpp>
int main() {
namespace x86 = ytl::assembler::ia_32;
std::vector<char> binary_buffer;
auto asm_gen = ytl::assembler::make_generator<x86::engine>( binary_buffer );
YTL_ASM_BEGIN( asm_gen )
@yutopp
yutopp / HSP反田える
Created October 30, 2012 15:18
何やってんじゃ・・・
#runtime "hsp3cl"
ERUTASO = "えい", "びー", "しー", "でぃー", "いー", "えふ", "じー", "えいち", "あい", "じぇー", "けー", "える", "えむ", "えぬ", "おー", "ぴー", "きゅー", "あーる", "えす", "てぃー", "ゆー", "ぶい", "だぶりゅう", "えっくす", "わい", "ぜっと"
kanji = "", "一", "ニ", "三", "四", "五", "六", "七", "八", "九"
unit_n = 1000, 100, 10, 1
unit = "千", "百", "十", ""
goto *@f
#defcfunc to_kanji int prm_num, local num