ruby
    ~
Advanced Hosters -

Dion
: 15.09.2008
: 3
# : 16, 2008 1:55 pm
, (. in.txt) (out.txt) (. test1)

GetLucky
: 08.08.2008
: 14
# : 16, 2008 4:10 pm
Smile

:

subs = "test1" #
lines = IO.readlines("in.txt")
text = IO.read("out.txt")
resultText = ""
resultFile = File.open("out.txt", "w")
charIndex = 0
lineIndex = rand(lines.length)
while charIndex < text.length
  if text[charIndex,subs.length] == subs
    resultText = resultText + lines[lineIndex].chomp
    charIndex = charIndex + subs.length
  else
    resultText = resultText + text[charIndex,1]
    charIndex = charIndex + 1
  end
end
resultFile.print(resultText)
resultFile.close


Dion
: 15.09.2008
: 3
# : 17, 2008 9:48 am
GetLucky , (out.txt) test1 (in.txt), .

GetLucky
: 08.08.2008
: 14
# : 17, 2008 11:11 am
Drinks or Beer

:
:

subs = "test1" #
lines = IO.readlines("in.txt")
text = IO.read("out.txt")
resultText = ""
resultFile = File.open("out.txt", "w")
charIndex = 0
while charIndex < text.length
  if text[charIndex,subs.length] == subs
    resultText = resultText + lines[rand(lines.length)].chomp
    charIndex = charIndex + subs.length
  else
    resultText = resultText + text[charIndex,1]
    charIndex = charIndex + 1
  end
end
resultFile.print(resultText)
resultFile.close


in.txt, .

, :
:

subs = "test1" #
lines = IO.readlines("in.txt")
text = IO.read("out.txt")
resultText = ""
resultFile = File.open("out.txt", "w")
charIndex = 0
while charIndex < text.length
  if text[charIndex,subs.length] == subs
    currentLine = lines[rand(lines.length)]
    resultText = resultText + currentLine.chomp
    if lines.length > 1
      lines.delete(currentLine)
    else
      lines = IO.readlines("in.txt")
    end
    charIndex = charIndex + subs.length
  else
    resultText = resultText + text[charIndex,1]
    charIndex = charIndex + 1
  end
end
resultFile.print(resultText)
resultFile.close


, , ( - ). . , .


: GetLucky ( 17, 2008 11:30 am), 1


Banned
: 21.02.2006
: 4966
# : 17, 2008 11:13 am
! ! Smile

GetLucky
: 08.08.2008
: 14
# : 17, 2008 11:35 am
Wink

Dion
: 15.09.2008
: 3
# : 17, 2008 3:52 pm
GetLucky
    ~