[null, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://2.bp.blogspot.com/-KCQK6c0q22U/V5xZAtZfvhI/AAAAAAAAHe8/utwpCSGJ9Mw5TAopYdt3qPIYzcLEwEi5wCKgB/s640/codevita-programming-geek.png", "src": "https://2.bp.blogspot.com/-KCQK6c0q22U/V5xZAtZfvhI/AAAAAAAAHe8/utwpCSGJ9Mw5TAopYdt3qPIYzcLEwEi5wCKgB/s640/codevita-programming-geek.png", "formatted_filename": "codevita programming geek", "rendered_width": 640, "rendered_height": 348}, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig1.png", "src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig1.png", "formatted_filename": "cv R R P fig", "rendered_width": 250, "rendered_height": 250}, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig2.png", "src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig2.png", "formatted_filename": "cv R R P fig", "rendered_width": 250, "rendered_height": 250}, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig3.png", "src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig3.png", "formatted_filename": "cv R R P fig", "rendered_width": 230, "rendered_height": 250}, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig4.png", "src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig4.png", "formatted_filename": "cv R R P fig", "rendered_width": 230, "rendered_height": 250}, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig5.png", "src": "https://www.tcscodevita.com/CodevitaV5/images/cv15R2_R1P2_fig5.png", "formatted_filename": "cv R R P fig", "rendered_width": 230, "rendered_height": 250}, null, null, null, null, null, null, null, {"document_url": "https://www.programminggeek.in/2016/07/rook-moves-tcs-codevita-2016-round1.html", "unformatted_src": "//lh3.googleusercontent.com/-FFqbSyAX4UU/AAAAAAAAAAI/AAAAAAAAAIA/Y8O6RRHSfPo/s80-c/photo.jpg", "src": "http://lh3.googleusercontent.com/-FFqbSyAX4UU/AAAAAAAAAAI/AAAAAAAAAIA/Y8O6RRHSfPo/s80-c/photo.jpg", "formatted_filename": "photo", "alt_text": "My photo", "rendered_width": 80, "rendered_height": 80}, null, null]
Rook Moves: TCS CodeVita 2016 Round1 Question

Problem : Rook Moves A Chess board position is accurately captured by Forsyth-Edwards notation and is abbreviated as FEN. A FEN "record" defines a particular game position, all in one text line and using only the ASCII character set. A FEN record contains six fields. A complete description of the FEN format to represent Chess positions can be found at here 
Similarly, 3 more half-moves are depicted in following diagrams 
3. rnbqkbnr/pppp1ppp/8/4P3/4P3/8/PPPP1PPP/RNBQKBNR w
4. rnbqkbnr/pppp1ppp/8/4p3/4PP2/8/PPPP2PP/RNBQKBNR b
5. rnbqkbnr/pppp1ppp/8/8/4Pp2/8/PPPP2PP/RNBQKBNR w

Wikipedia describes first field of FEN format as follows

The second field denotes whose move it is now. "w" depicts that it is White's turn to play and "b" indicates that it is Black's turn to play

CodeVita Problem Statement

Given a board position in FEN format, your task is to find out all the move(s) that Rook(s) of the playing side can make.





Print Specification:

Labels: CODEVITA , CodeVita 2016 , CodeVita 2016 Round1 , Rook Moves , TCS CodeVita 2016 Question