Shell Programming Blog Shell Programming Blog

Thursday, 11 October 2012

Linux Bash Scripting: how to print a big chess board anywhere on the screen

abu sittik | 11:12 |


Bash Linux Unix shell scripting


In this post, we will see how to create a big chess board that can be displayed anywhere on the screen rather than being displayed left aligned. Below is the script which displays the Chess board on the screen.



If you want to make changes to the above script for changing the size and the position of the chess board, you can change the following variables in the script.

1) row - to change the number of lines to leave from top before printing the chess board
2) col - to change the number of columns to leave from left before printing the chess board
3) j in second for loop - to increase or decrease the height of the block
4) No. of spaces in echo statement to change the width of the block


The same script using C style for loop:



0 Comments:

   

Post a Comment

Don't just read and walk away, Your Feedback Is Always Appreciated. I will try to reply to your queries as soon as time allows.

Note:
1. If your question is unrelated to this article, please use our Facebook Page.
2. Please always make use of your name in the comment box instead of anonymous so that i can respond to you through your name and don't make use of Names such as "Admin" or "ADMIN" if you want your Comment to be published.
3. Please do not spam, spam comments will be deleted immediately upon my review.

Regards,
Mohamed Abubakar Sittik A

 

Shell Programming Copyright © 2012 Shell Programming theme is Designed by Abusittik, Shell Programming