;)
Original post: http://basenothing.blogspot.com/2009/04/much-ado-about-nothing-i-think-as-i.html
function CutSwap ( byref txt as string, byval idx0 as integer, byval idx1 as integer, byref newtxt as string ) as string
dim as string firsthalf = LEFT(txt,idx0), secondhalf = RIGHT(txt,len(txt)-(idx1+1))
return firsthalf + newtxt + secondhalf
end function
function ThisSentenceIsFalse ( byref s as string, byval it as integer ) as string
if it<1 then return s
dim as string res = CutSwap( s, InStr( "This sentence", s)-1, len("This sentence"), s & " " )
return ThisSentenceIsFalse ( res, it-1 ) & " "
end function
? ThisSentenceIsFalse ( "This sentence is false", 7 )
? 2^7
sleep
No comments:
Post a Comment