```lua
------------PART 1-------------
---===DECLARING VARIABLES======
--1. We shall declare x and y coordinates of two lines.
--i. Line 1 is a wall:
x1 = 9
y1 = 0
x2 = 9
y2 = 30
--ii.Line 2 is a ray:
x3 = 10
y3 = 10
x4 = 0
y4 = 10
-------------------------------
---------PART 2----------
---===TIC FUNCTION===---
--It's the main function
function TIC()
cls()
--------PART 3 ------------
--===LETS DRAW THE TWO LINES==---
--1. We draw the wall
line(x1,y1,x2,y2,12)
--2. We draw the ray
line(x3,y3,x4,y4,12)
------------PART 4 -------------------
--===LINE COLLISION DETECTION==---
--1. In this section, we have to have some math, with three things:
-- den, t and u.
--2. t and u are mathematical equations.
--3. If a collision happens, 0<t<1 and u>0.
--4. den is a denomitor declared as a shortcut to find t and u
-- and also used to check whether itself is zero.
-- If it is zero, then it brings about an error.
-- If confused, don't worry, it'll be clear below. This is just an overview
--Slowly we shall do these in steps:
--1. We declare den, aka the denominator
den = (x1-x2)*(y3-y4)-(y1-y2)*(x3-x4)
--2. We look for t and u. Therse are equations for getting the line detection.
t = ((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4))/den
u = -((x1-x2)*(y1-y3)-(y1-y2)*(x1-x3))/den
--3. As mentioned above, t and u are used for checking for a line collision
-- If 0<t<1 and u>0, then a collision between the ray line and the wall line has happened.
if (t>0 and t<1 and u>0) then
print("true",100,100,12)
return true
else
print("false",100,100,12)
return nil
--we return nil as no collision has happened between the ray line and the wall line.
end
--NOW, if the denominator is zero,
--it would be an error. Thus we return nil.
if den == 0 then
return nil
end
end
```