mirror of
https://github.com/izumariu/puberty.git
synced 2025-06-18 21:45:40 -04:00
Added truth machine example and fixed an interpreter glitch
This commit is contained in:
parent
da1768a57f
commit
c5df3b28be
19
compiler_template.s
Normal file
19
compiler_template.s
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
.text
|
||||||
|
.global _start
|
||||||
|
|
||||||
|
_start:
|
||||||
|
mov $1, %rax
|
||||||
|
mov $1, %rdi
|
||||||
|
mov $msg, %rsi
|
||||||
|
mov $msl, %rdx
|
||||||
|
syscall
|
||||||
|
|
||||||
|
mov $60, %rax
|
||||||
|
xor %rdi, %rdi
|
||||||
|
syscall
|
||||||
|
|
||||||
|
msg:
|
||||||
|
.ascii "Hello world!"
|
||||||
|
.set msgl, .-msg
|
||||||
|
|
||||||
|
.bss
|
13
examples/truthmachine.fap
Normal file
13
examples/truthmachine.fap
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
It is June 13th, 2018, 08:42:40 AM. Izu is in his bed, bored. His secret
|
||||||
|
kinks are balloons, rubber, fat, thighs, butts and moobs. Suddenly the following sounds become audible.
|
||||||
|
|
||||||
|
oh balloons,hnng rubber,hnng thighs,hnng
|
||||||
|
|
||||||
|
hrg
|
||||||
|
fat,hnng fap fap fap fap fap fap fap fap fap fap fap fap fap fap fap fap
|
||||||
|
hrg
|
||||||
|
yes
|
||||||
|
mmf
|
||||||
|
mmf
|
||||||
|
|
||||||
|
fat,hnng fap fap fap fap fap fap fap fap fap fap fap fap fap fap fap fap yes sigh
|
@ -50,10 +50,10 @@ PRONOUNS={
|
|||||||
|
|
||||||
->{
|
->{
|
||||||
_phrase = $CONTENT.shift.strip
|
_phrase = $CONTENT.shift.strip
|
||||||
if _phrase.match /^(Then|Suddenly)/
|
if _phrase.match /^(Then|Suddenly)\\s+the/
|
||||||
_rxp=Regexp.new("^(Then|Suddenly)\\s+#{PRONOUNS[GENDER][:personal]}\\s+spot#{PRONOUNS[GENDER][:verb_suffix]}\\s+(.+)$", Regexp::MULTILINE)
|
_rxp=Regexp.new("^(Then|Suddenly)\\s+#{PRONOUNS[GENDER][:personal]}\\s+spot#{PRONOUNS[GENDER][:verb_suffix]}\\s+(.+)$", Regexp::MULTILINE)
|
||||||
_m = _phrase.match _rxp
|
_m = _phrase.match _rxp
|
||||||
_m||abort("OOPS WRONG SYNTAX IN FOURTH INTRO SENTENCE")
|
_m||abort("OOPS WRONG SYNTAX IN FOURTH INTRO SENTENCE (#{_phrase.inspect})")
|
||||||
$REGS[0] = 2**(KINKS.index(_m[2].downcase)+2)
|
$REGS[0] = 2**(KINKS.index(_m[2].downcase)+2)
|
||||||
else
|
else
|
||||||
$CONTENT.unshift _phrase
|
$CONTENT.unshift _phrase
|
||||||
@ -64,7 +64,7 @@ PRONOUNS={
|
|||||||
_phrase = $CONTENT.shift.strip
|
_phrase = $CONTENT.shift.strip
|
||||||
_rxp=Regexp.new("^(Soon|Then|Suddenly)\\s+the\\s+following\\s+sounds\\s+become\\s+audible$", Regexp::MULTILINE)
|
_rxp=Regexp.new("^(Soon|Then|Suddenly)\\s+the\\s+following\\s+sounds\\s+become\\s+audible$", Regexp::MULTILINE)
|
||||||
_m = _phrase.match _rxp
|
_m = _phrase.match _rxp
|
||||||
_m||abort("OOPS WRONG SYNTAX IN #{$REGS[0]==0 ? "FOURTH" : "FIFTH"} INTRO SENTENCE")
|
_m||abort("OOPS WRONG SYNTAX IN #{$REGS[0]==0 ? "FOURTH" : "FIFTH"} INTRO SENTENCE (#{_phrase.inspect})")
|
||||||
}.call
|
}.call
|
||||||
|
|
||||||
$CONTENT = $CONTENT.join(".").gsub(/ngh.+hhh/,"").gsub(/\s+/," ").strip.split
|
$CONTENT = $CONTENT.join(".").gsub(/ngh.+hhh/,"").gsub(/\s+/," ").strip.split
|
||||||
@ -102,9 +102,25 @@ until $IPTR == $CONTENT.length
|
|||||||
when /^yes$/i
|
when /^yes$/i
|
||||||
putc $REGS[$REGPTR]
|
putc $REGS[$REGPTR]
|
||||||
when /^oh$/i
|
when /^oh$/i
|
||||||
$REGS[$REGPTR] = gets.chomp[0]
|
$REGS[$REGPTR] = gets.chomp[0].ord
|
||||||
when /^hrg$/i
|
when /^hrg$/i
|
||||||
$RETSTACK << $IPTR
|
unless $REGS[$REGPTR] == 0
|
||||||
|
$RETSTACK << $IPTR
|
||||||
|
else
|
||||||
|
|
||||||
|
->{
|
||||||
|
|
||||||
|
_depth = $RETSTACK.length
|
||||||
|
_current = _depth+1
|
||||||
|
until _depth == _current
|
||||||
|
$IPTR += 1
|
||||||
|
$CONTENT[$IPTR].match(/^hrg$/i)&&(_current+=1;next)
|
||||||
|
$CONTENT[$IPTR].match(/^mmf$/i)&&(_current-=1;next)
|
||||||
|
end
|
||||||
|
|
||||||
|
}.call
|
||||||
|
|
||||||
|
end
|
||||||
when /^mmf$/i
|
when /^mmf$/i
|
||||||
$REGS[$REGPTR] == 0 ? $RETSTACK.pop : $IPTR=$RETSTACK[-1]
|
$REGS[$REGPTR] == 0 ? $RETSTACK.pop : $IPTR=$RETSTACK[-1]
|
||||||
when /^squirt$/i
|
when /^squirt$/i
|
||||||
|
Loading…
Reference in New Issue
Block a user