Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/careercup/CtCI-6th-Edition-JavaScript
/ findByte
Function
findByte
chapter05/5.8 - Draw Line/drawLine.js:5–8 ·
view source on GitHub ↗
(x, y, width)
Source
from the content-addressed store, hash-verified
3
var
pixel;
4
5
var
findByte =
function
(x, y, width) {
6
var
start = y * width / 8;
7
return
start + Math.floor(x / 8);
8
};
9
10
var
findPixel =
function
(x) {
11
return
x % 8;
Callers
1
drawLine
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected