• Welcome to Bashguru

    Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. It's functionality list is quite similar to that of UNIX and become very popular over the last several years. Our Basic motive is to provide latest information about Linux Operating system.

  • Python Programming

    Python is a comparatively simple programming language, compared to c++. Although some of the benefits of c++ are abstracted away in python, they are replaced with an overall easier to learn language with many “intuitive” features. For this reason it is common and recommended by most professionals that people new to programming start with python.

  • Perl Programming

    Perl is an open-source, general-purpose interpreted programming language. Used often for CGI, Perl is also used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications. The Perl languages borrow features from other programming languages including C, shell scripting (sh), AWK, and sed. They provide powerful text processing facilities without the arbitrary data-length limits of many contemporary UNIX command line tools, facilitating easy manipulation of text files.

  • Android

    Android is an operating system based on the Linux kernel, and designed primarily for touch screen mobile devices such as smart phones and tablet computers. Android is a Linux-based software system, and similar to Linux, is free and open source software. This means that other companies can use the Android operating developed by Google and use it in their mobile devices.Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

Friday, April 25, 2008

Posted by venu k
14 comments | 10:02 PM

Small Chess Board


#!/bin/bash
# SCRIPT : smallchessboard.sh
# PURPOSE : Prints small chess board on the screen.

clear
for (( i=1 ; i<=8 ; i++ ))
do

for (( j=1 ; j<=8 ; j++ ))
do

if [ `expr $(($i+$j)) % 2` -eq 0 ]
then
echo -e -n "\033[47m " # White background
else
echo -e -n "\033[40m " # Black background
fi

done
echo # move to next line

done

echo -e "\033[0m" # Restores color settings.


OUTPUT:


Big Chess Board


#!/bin/bash
# SCRIPT : bigchessboard.sh
# PURPOSE : Prints big chess board on the screen.

clear
a=4

for (( i=1 ; i<=8; i++ ))
do

for (( j=1 ;j<=2; j++ )) # prints same line twice
do
tput cup $a 15 # moves cursor to LINE COLUMN

for (( k=1 ; k<=8; k++ ))
do

c=`expr $((i+k)) % 2`

if [ $c -eq 0 ]
then
echo -e -n "\033[40m " # Black background
else
echo -e -n "\033[47m " # White background
fi

done
let a=a+1

done

done

echo -e "\033[0m" # Restores color settings
read key # Waits for enter


OUTPUT:


14 comments:

  1. nice one...
    but still change are better.



    #!/bin/sh

    for m in `seq 8` ### Outer for loop ###
    do
    for n in `seq 8` ### Inner for loop ###
    do
    T=`expr $m + $n`
    S=`expr $T % 2`
    if [ $S -eq 0 ]; then
    echo -e -n "\033[47m " ### white ###
    else
    echo -e -n "\033[40m " ### black ###
    fi
    done
    echo -e -n "\033[40m" #### background colour=black ###
    echo "" #### printing new line ###
    done

    ReplyDelete
  2. Can you please anybody explain clearly. I am unable to write it.

    ReplyDelete
  3. In this article I'm going to uncover abilities essential for Internet showcasing achievement, including what to keep away from. Effective Internet advertising isn't just about the "do"s." It's likewise about the don'ts. I will examine both in connection to how to profit on the web, beneath. http://www.mordocrosswords.com/2016/09/chessboard-piece.html

    ReplyDelete
  4. Wonderful article,does chess improve programming skills thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.

    ReplyDelete
  5. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. chess sets

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    big-data-hadoop-training-institute-in-bangalore

    ReplyDelete
  8. I prefer to read the quality content. I like it.

    ReplyDelete
  9. I got too much interesting stuff on your blog. I guess I am not the only one having all the enjoyment here! Keep up the good work. Best Glass Chess Sets

    ReplyDelete
  10. DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit

    Are you seeing DevOps in your future? Perhaps you are already exploring where to start learning DevOps, choose myTectra the market leader in Devops training.
    CHAPTER 2: UNDERSTAND COMMON INFRASTRUCTURE SERVERS
    CHAPTER 3: IMPLEMENT AUTOMATED INSTALLATIONS AND DEPLOYMENTS
    CHAPTER 4: UNDERSTAND PERFORMANCE TUNING ASPECTS AND BASIC SECURITY FOR INFRASTRUCTURE
    CHAPTER 5: INSTALLATION & CONFIGURATION OF JENKINS AND PUPPET
    CHAPTER 6: INTRODUCTION TO AUTOMATION WITH ANSIBLE AND SALTSTACK
    CHAPTER 7: AUTOMATION WITH CHEF
    CHAPTER 8: MONITORING, LOGGING, TOMCAT AND SYSTEM TOOLS

    ReplyDelete
  11. Really your post is really very good and I appreciate it. It’s hard to sort the good from the bad sometimes.You definitely put a new spin on a topic thats been written about for years.
    webnovel

    ReplyDelete