Skip to content

Instantly share code, notes, and snippets.

@hanachin
Last active August 14, 2019 11:21
Show Gist options
  • Save hanachin/481f6119203a392a9a60a054631985e2 to your computer and use it in GitHub Desktop.
Save hanachin/481f6119203a392a9a60a054631985e2 to your computer and use it in GitHub Desktop.
$<.map{|l,n=1|l[l.to_i.to_s n+=1]||redo;p n}
$<.map{|l,n=1|l[l.to_i.to_s n+=1]||redo;n}
#!ruby -n
$_[$_.to_i.to_s n=n.to_i+1]||redo;p n
__END__
#!ruby -n
$_[$_.to_i.to_s n=n.to_i+1]||redo;p n
$<.map{|l=n=1|$_[$_.to_i.to_s n+=1]||redo;p n}
__END__
$<.map{|l,n=1|l[l.to_i.to_s n+=1]||redo;p n}
__END__
$<.map{|l,n=1|l[l.to_i.to_s n+=1]||redo;p n}
__END__
#!ruby -n
p 2.step.find{|n|$_[$_.to_i.to_s n]}
#!ruby -n
n||=1;$_[$_.to_i.to_s n+=1]||redo;p n
__END__
#!ruby -an
p ?1.find{|n|$_.to_i==$F[1].to_i(n)}
__END__
p 2.step.find{|n|$_[$_.to_i.to_s n]}while gets
$<.map{|l|p 2.step.find{|n|l[l.to_i.to_s n]}}
__END__
n=1;p {$_[$_.to_i.to_s n]}
~/ /;(2..10).index{}
p 2.step.find{|n|$_[$_.to_i.to_s n]}
p[]*10.index{|n|$_[$_.to_i.to_s n]}
__END__
n=1;1 until$_.to_i.to_s(n+=1);p n
$n=1;1 until$_[$_.to_i.to_s n+=1];p n
__END__
$<.map{|l|$.+=1 until l[l.to_i.to_s$<[$.]]}
$<.map{|l|1 until l[l.to_i.to_s rand 2..10]]}
p 2.step.find{|n|$_[$_.to_i.to_s n]}
# puts$<.map{2.step.find{|n|l[l.to_i.to_s n]}}
# $<.map{"p 2.step.find{|n|#$_.to_s n}"}
# $<.map{|l|p 2.step.find{|n|l[l.to_i.to_s n]}}
#!ruby -an
# p 2.step.find{|n|a,b=$F;a=="#{b.to_i n}"}
# p 2.step.find{|n|a,=$F;eval [a,'.to_s ']
# p 2.step.find{|n|,b=$F;a.to_i["#{b.to_i n}"]}
# 1 until$_[$_.to_i.to_s $.=rand(2..10)];p$.
def get_statistics(s)
a=[0,0,0,0]
an=/[a-zA-Z0-9]/
ws=/[ \t\n]/
s.each_byte{|x|
s=x.chr
a[an=~s ?2:ws=~s ?1: x<127&&x>32?3:0]+=1
}
a
end
p get_statistics(<<EOS)
$<.map{|l|p 2.step.find{|n|l[l.to_i.to_s n]}}
EOS
# ここから↓提出
# $<.map{|l,n=1|l[l.to_i.to_s n+=1]||redo;p n}
# $<.map{|l|p 2.step.find{|n|l[l.to_i.to_s n]}}
#!ruby -n
# p 2.step.find{|n|$_[$_.to_i.to_s n]}
#!ruby -n
# n=1;1 until$_[$_.to_i.to_s n+=1];p n
#!ruby -n
# p (2..10).find{|n|$_[$_.to_i.to_s n]}
#!ruby -an
# p (2..10).find{|n|a,b=$F;a=="#{b.to_i n}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment