Horje
Calculate Grains on a given square on a chessboard js Code Example
Calculate Grains on a given square on a chessboard js
//Calculate Grains on a given square on a chessboard
const totalGrains = 2 ** 64 - 1;

const grainsOn = (input) => {
  const grainCount = 2 ** (input - 1);
  return grainCount;
};
console.log(`Grains on 6th square: ${grainsOn(6)}`);
console.log(`Total grains on the Chess Board: ${totalGrains}`);




Javascript

Related
tab pane full calendar not showing Code Example tab pane full calendar not showing Code Example
javascript code speed test Code Example javascript code speed test Code Example
Get all child inputs in a div element (JQuery) Code Example Get all child inputs in a div element (JQuery) Code Example
working with binary and base64 data Code Example working with binary and base64 data Code Example
angularjs substring Code Example angularjs substring Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8