function drawline(x0,y0,x1,y1){
dx = x1-x0
dy = y1-y0
len = sqrt(dx*dx+dy*dy)
dx /= len
dy /= len
for (k=0;k<=len;k++){
paint(floor(x0),floor(y0))
x0 += dx
y0 += dy
}
}
Sorry, Only C is accepted.
Fuck that, I decided to benchmark it myself:
fvdrawline: 1917 cycles
asmdrawline: 1203 cycles
I win.
Name:
Anonymous2013-08-10 9:52
>How would you compress all the information of the earth in a smaller volume
>You just compress the earth mechanically.
7zip just compressed my harddisk into a smaller volume.
The more you know.jpg