Retired

Calculate chess move number (retired)

Description:

In two-player sequential games like chess, a ply is one turn taken by one of the players. However, in standard chess terminology, one move consists of a turn by each player; therefore a ply in chess is a half-move.

So, ply 0 is the first move of white, ply 1 the first move of black.

Write a function that takes a ply number and returns the move number.

For example:

calculateMove(0) returns 1
calculateMove(1) returns 1
calculateMove(2) returns 2
calculateMove(3) returns 2
calculateMove(100) returns 51
Algorithms
Numbers
Data Types
Mathematics
Logic
Arithmetic

More By Author:

Check out these other kata created by juggler39

Stats:

CreatedSep 15, 2020
Warriors Trained21
Total Skips1
Total Code Submissions18
Total Times Completed9
JavaScript Completions9
Total Stars1
% of votes with a positive feedback rating0% of 5
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes5
Total Rank Assessments5
Average Assessed Rank
8 kyu
Highest Assessed Rank
8 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • juggler39 Avatar
Ad