########################### code start
def decrypt(data,shift = 27)
	if shift<27 then # if not 27 they know key
		datanew=String.new(data.upcase)
		a = datanew.size-1 # control loop
		while a>-1 
			if datanew[a] - shift<65 then #check if it is out of bound of 
				datanew[a]=datanew[a]-shift+26#works in my head
				else datanew[a]=datanew[a]-shift
			end
			a-=1
		end
		print datanew.downcase,"  	key=",shift,"\n" #plain text lower case
	else 
		for b in 0..25 # loop ever case 
			decrypt(data,b)
		end
	end
end

def encrypt(data,shift = rand(26))
		
		a = data.size-1
		while a>-1 
			if data[a]+shift>122 then
				data[a]=data[a]+shift-26
				else data[a]=data[a]+shift
			end
			a-=1
		end
		data= data.upcase
		print data,"	key=",shift,"\n"
end


it=String.new("abcdefghij")
encrypt(it)
decrypt(it)
############################code end
it is the wonderful ceaser shift, you add or subtract a key to the char.
Anyway, I am lost on why i have to create a copy of the string in
decrypt. I know why my it string gets crushed because encrypt uses it.
How does one make it use a copy of the varablie instead of pointing to
the memory location? also how do you return a value in a
function(def)? If you do not want to tell me because you dont think i
read the chm file, then please tell me where i can read how to do this
(simple examples would also be great)?
Thank you for your time.
Stephen Becker