Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function draw_matrix(matrix,max_x,max_y,ot,dos)
- startX= 1
- startY= 1
- c= 2
- for y=1,6 do
- for x=1,6 do
- term.setCursorPos(startX,startY)
- if c > ot and c < dos
- then
- write(matrix[c])
- startX=startX+5
- else
- write(matrix[c])
- startX=startX+4
- end
- c= c+1
- end
- startY= startY+1
- startX= 1
- end
- end
- function add_arrays(arr1,arr2)
- len1= #arr1
- len2= #arr2
- arr3= arr1
- for i=len1,len1+len2 do
- arr3[#arr3+1]= arr2[i]
- end
- return arr3
- end
- X,Y= term.getSize()
- rednet.open("top")
- data= {"start"}
- message= textutils.serialize(data)
- rednet.send(1,message)
- id,message= rednet.receive()
- if id == 1
- then
- data= textutils.unserialize(message)
- end
- a= 2
- b= 7
- numbers={}
- while true do
- term.clear()
- draw_matrix(data,X,Y,a,b)
- print()
- print()
- print("Enter numbers ot ",a-1," to ",b-1)
- number= read()
- stat= false
- for i=a,b do
- if number+0 == data[i]
- then
- a= b
- b=b+6
- stat= true
- end
- end
- if stat == true
- then
- numbers[#numbers+1]= number
- end
- if b == 43
- then
- break
- end
- end
- print("Enter your Name :")
- name= read()
- data= {"finish"}
- data[2]= name
- data= add_arrays(data,numbers)
- message= textutils.serialize(data)
- rednet.send(1,message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement