function moveRight() {
        undraw()
        const isAtRightEdge = current.some(index => (currentPosition + index) % width === width-1)
    
        if(!isAtRightEdge) {
            currentPosition += 1
        }
        if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {
            currentPosition -=1
        }
        draw()
    }
// move the tetramino left unless there end of grid or there is a blockage
move the tetramino left unless there end of grid or there is a blockage
move the tetramino left unless there end of grid or there is a blockage
function moveRight() {
        undraw()
        const isAtRightEdge = current.some(index => (currentPosition + index) % width === width-1)
        if(!isAtRightEdge) {
            currentPosition += 1
        }
        if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {
            currentPosition -=1
        }
        draw()
    }
function moveRight ( ) { undraw ( ) const isAtRightEdge = current . some ( index => ( currentPosition + index ) % width === width - 1 ) if ( ! isAtRightEdge ) { currentPosition += 1 } if ( current . some ( index => squares [ currentPosition + index ] . classList . contains ( 'taken' ) ) ) { currentPosition -= 1 } draw ( ) }
move the tetramino left unless there end of grid or there is a blockage
move the tetramino left unless there end of grid or there is a blockage