Saturday, July 28, 2012

लक्ष्मीप्रसाद देवकोटा द्वारा रचिएको पागल कबिता

जरूर साथी म पागल !
यस्तै छ मेरो हाल।
म शब्दलाई देख्दछु !
दृश्यलाई सुन्दछु !
बासनालाई संबाद लिन्छु।
आकाशभन्दा पातला कुरालाई छुन्छु।
ती कुरा, जसको अस्तित्व लोक मान्दैंन
जसको आकार संसार जान्दैन !
म देख्दछु, ढुङ्गालाई फूल !
जब, जलकिनारका जल चिप्ला ती,
कोमलाकार, पाषाण,चाँदनीमा,
स्वर्गकी जादूगर्नी मतिर हाँस्दा,
पत्रिएर, नर्मिएर, झल्किएर,
बल्किएर, उठ्दछन् मूक पागलझैँ,
फूलझैँ- एक किसिमका चकोर फूल !
म बोल्दछु तिनसँग, जस्तो बोल्दछन् ती मसँग
एक भाषा, साथी !
जो लेखिन्न, छापिन्न, बोलिन्न,
बुझाइन्न, सुनाइन्न।
जुनेली गङ्गा-किनार छाल आउँछ तिनको भाषा
साथी ! छाल छाल !
जरुर साथी म पागल !
यस्तै छ मेरो हाल !
तिमी चतुर छौ, वाचाल !
तिम्रो शुद्ध गणित सूत्र हरहमेशा चलिरहेको छ
मेरो गणितमा एकबाट एक झिके
एकै बाँकी रहन्छ !
तिमी पाँच इन्द्रियले काम गर्छौ,
म छैटौँले !
तिम्रो गिदी छ साथी !
मेरो मुटु।
तिमी गुलाफलाई गुलाफ सिवाय देख्न सक्तैनौ,
म उसमा हेलेन र पद्मिनी पाउँछु,
तिमी बलिया गद्य छौ !
म तरल पद्य छु !
तिमी जम्दछौ जब म पग्लन्छु,
तिमी सँग्लन्छौ जब म धमिलो बन्छु,
र ठीक त्यसैका उल्टो !
तिम्रो संसार ठोस छ।
मेरो बाफ !
तिम्रो बाक्लो, मेरो पातलो !
तिमी ढुङ्गालाई वस्तु ठान्दछौ,
ठोस कठोरता तिम्रो यथार्थ छ।
म सपनालाई समात्न खोज्दछु,
जस्तो तिमी, त्यो चिसो, मीठो अक्षर काटेको
पान्ढीकीको बाटुलो सत्यलाई !
मेरो छ वेग काँडाको साथी !
तिम्रो सुनको र हीराको !
तिमी पहाडलाई लाटा भन्दछौ,
म भन्छु वाचाल।
जरुर साथी।
मेरो एक नशा ढिलो छ।
यस्तै छ मेरो हाल !

Monday, June 04, 2012

Los Angeles Trip April 2012


Participants :- Bishal Acharya, Nishikar sapkota, Dinesh Bajracharya, Anjana Shakya, Umang Amatya, Krishna Prasad Shrestha



Start destination Las Vegas Nevada : Bus stop at Ballys Hotel & casino
Target Destination : Downtown Los Angeles California


Having lived in Las Vegas for quite a few months. The harbinger, Spring break, has finally arrived calling for a change. This break we have planned to visit Los Angeles in California.

Venues selected to make a trip :

Universal studios Hollywood
Downtown Los Angeles
Santa Monica Beach
Venice Beach

The pick of the spot was undoubtedly Universal Studios.

House Of Horrors
Shreak 4d
Terminator 3d
Simpsons Ride
Jurassic Park
King Kong 3D
Universal Studios Ride
Water World
Animal World
Revenge of the Mummy : The indoor Roller Coaster

We opted to book a hotel in Inglewood California . Although an hour drive to Hollywood it suited us simply because it was cheap. However, the location failed to catch our attention because the place looked rustic full of people with shabby clothes. I did not expect the first impression of California to be this. However, we were hopeful that things would be far better the next day at Universal Studios. To my surprise at inglewood restaurants were all shut down by 10 o'clock. The next day we took a bus to Hollywood. We could at least thank GPS in our cell phones without which we could have been in trouble locating bus stations and our destination. Universal studios was simply awesome. We had a lot of fun. The place was an inspiration to people who admire science. I simply loved the virtual reality of Simpsons ride. King Kong 3D and Jurassic park were also awesome. I don't get enough words admiring people who have made this amazing place for entertainment. All of us got a chill in our spines when we fell vertically down in the Jurassic park fall more than 100 ft high. Although I was expecting Revenge of the Mummy to be an outdoor Roller Coaster, It was not. It was a speedy indoor roller coaster. It was fun considering Umang who had kept his eyes shut throughout.

After Universal studios, the next day we went to santa monica beach. It was also a very good experience for all of us. Considering whatever fun we had in these two days, I wished my country Nepal although naturally rich  had some places like Universal Studios.


Returned back to Las Vegas after an exciting two days trip in LA.



Los Angeles



Other Trips
Los Angeles Trip April 2012
Utah Trip-Hike 2012
Into the wild - Chitwan national park 2011
Hike To Sarangkot and RSR 2011

My Travel directory : Places I have been to

Traveling is fun. Most of the people like to travel and I am a no objection to this. I have started this post so that I could write down the places I have visited. Few decades after, I think this article would be the one I shall cherish the most.

Although, traveling has been my passion, I haven't had the opportunity till date to travel to many parts of the world that has remained in my mind as dreams.  When I was a child, I regret I was unable to do any traveling at all. I was born in a city called Biratnagar in Nepal and I did not even go to other city until I was 10 years of age when I made my debut of traveling to a different city called Dharan in Nepal. Kathmandu the capital city of Nepal was on the lucky cards when I got a chance to witness her when I was studying in class seven. My cousins marriage was the auspicious occasion why I made that trip. I still remember catching a black Tampu in kalanki [ The Tampu I regret has perished from the history ] upto Baneshwor.

So, Here I am at Kathmandu. It was really fun and as a 11 year old boy, I enjoyed each and every moment I witnessed there. I still remember those days as clear as a crystal. So, my travel history thus started. I went to eastern part of Nepal Jhapa to attend my mama's wedding during same time. Now was the time I had to make some serious travel. I went to Japan in 2008 when I was 23 years of age. The midway destination to japan was Incheon Korea, the transit place for my destination.This was my first international travel. While in Japan I lived in Wakkanai, Hokkaido but also traveled to Rumoi, Soya Misaki, Sapporo and Tokyo. I returned back to Nepal on 2009 but was lucky again to step in Hongkong on the way.

Although I have been to India, I don't want to include it as my international travel because India was too close to my city. We used to go to an Indian town called Gojbani in bicycle when we were children's.

Here I am back to Nepal. Although two years from now, I would not make any international travel but I did make some wonderful travels in Nepal while working in D2Hawkeye Services Pvt Ltd. I went to Chitwan, Dhulikhel, Pokhara, KavrePalanchowk, SindhuPalchowk. I also did my first Bungy jump during this time above the Bhotekoshi river. Now, on January 9 2012, I am at Tribhuwan International airport KTM waiting for Qatar airways flight to Doha Qatar. I am on my way to United States, the country I had dreamt of going to. Doha airport was fun as there were many Nepali workers there. Seemed like a mini Nepal to me. The next transit being one of my favorite countries Germany. This is another country I really dream of exploring. I stepped in Frankfurt but could not explore its history. 

From Germany, I took a flight of Delta Airlines to United States. Michigan was officially the first state in USA that I stepped on. So here starts the states count. I shall try to preserve the states and city I have been to in United states.

1st state : Michigan [Detroit] 2012 January

2nd state : Nevada - Las Vegas [The Sin City I have been living in]
Places in Nevada : Cities : Las Vegas | Boulder City | Henderson Red Rock Canyon : December 2012 | Valley of Fire : November 2012 | Mount Charleston : December 2012 & January 2011 | Hoover Dam | Lake Mead | Wynn Resorts | Encore | Bellagio | Caesars Palace | Venetian | Excalibur | Luxor | Mandalay Bay | New York New York | Planet Hollywood | Bally's | Flamingo | Cosmopolitan | Aria Rosorts & casino | Rio | Palazzo | Treasure Island

3rd State : Arizona [Hoover Dam] 2012 March

Williams City Arizona
Grand Canyon : December 22 2012

4th state : California
Los Angeles [I went there in 2012 Spring : Universal studios, Santa Monica Beach, Inglewood]
Death Valley : 27 December 2012
5th State : Utah - St. George & Zion National Park 2012 May
6th state :
Idaho
7th state :
Oregon : Portland, Pendleton
8th state :
Washington : Seattle, Bellevue, Redmond, Spokane, kent
9th state :
Texas : Houston, Dallas 10th state :
Illinois : Chicago, Naperville 11h state :
Indiana : Indiana Sand Dunes 12th state :
Wisconsin : Wis Dells 13th state :
Michigen : Lake Superior, Holland 14th state :
Missouri : St. Louis, Meramec Caverns 15th state :
Kansas : Kansas city 16th state :
Pennsylvania : Harrisburg, Hersheys 17th state :
New Jersey : 18th state :
New York : New York City 19th state :
Virginia : Washington DC 20th state :
Maryland : Baltimore 21st state :
California : Orange County, Irvine and the counter goes on... Serious Travel destinations on the cards are listed below. I would be happy If someone can advise me some really good pristine traveling places.

1. Iceland
2. England
3. Germany
4. Galapagos-Equador
5. Egypt - The pyramids
6. Italy - Venice & Sicily
7. maldives - Islands

I wish the counter moves ahead........

Program to calculate number of digits in an integer & sum of numbers of an integer

The following C++ program calculates the the number of digits in a given integer and the sum of all digits of an integer.



 #include <iostream>  
 #include <cmath>  
 using namespace std;  
 /*@author Bishal Acharya  
 The idea of summing the numbers in an integer is to take  
 a division of the number from ones to final units of the number  
 and then take a modulo against 10*/  
 class SumOfInteger {  
  int number;  
  public :  
  int getSummation(int);   
  int numberOfDigits(int);  
 };  
 /*Gets the number of digits in an integer. Have to make  
 sure that we dont calculate log value of 0 */  
 int SumOfInteger::numberOfDigits(int number){  
  int digits = 0;  
  digits = floor(log10(abs (number != 0 ? number :1))) +1;  
  return digits;  
 }  
 /*Returns the sum of numbers in an integer*/  
 int SumOfInteger::getSummation(int number){  
  int noOfDigits;  
  noOfDigits = numberOfDigits(number);  
  int sum =0;  
  int power =0;  
  for(int i=0; i< noOfDigits; i++){      
   power = pow(10,i);  
   sum = sum + (number / power) % 10;  
  }   
  return sum;  
 }  
 int main(){   
  int number = 0;  
  cout << "Enter the number :";  
  cin >> number;  
  int sum =0;  
  SumOfInteger sumObj;  
  sum = sumObj.getSummation(number);  
  cout << "The sum of the integer numbers :" << sum << endl;  
 }  

Output of the given program :-
Enter the number : 123
The sum of the integer numbers : 6

Alternative program to calculate number of digits in an number :-

 #include<iostream>  
 using namespace std;  
 int main(){  
  int number = 0;  
  cout << "Enter the number" << endl;  
  cin >> number;  
  int count;  
  while(number !=0){  
    number = number/10;  
    count++;  
  }  
  cout << "The number of digits in the number is :" << count;  
 }  

Program to reverse the digits in the given number. For eg :- if given number is 123 then the reversed value should be 321


 #include  
 using namespace std;  
 int main(){  
   int number = 0;  
   cout <<"enter the number :"<< endl;  
   cin >> number;  
   int reverse = 0;  
   while(number !=0){  
     reverse = reverse*10 + number%10;  
     number = number%10;  
   }  
 cout <<"The reversed number is :" << reverse;  
 }  

Benchmarks in Java program : Time it took to calculate number of digits in a number with log approach and with while loop approach.


 public static void main(String[] args) {  
           int number = 0;  
           int temp = 0;  
           Random rnd = new Random();  
           int range = 1;  
           while (range < 10) {  
                number = rnd.nextInt();  
                temp = number;  
                System.out.print("Number :" + number + "TimeWhile :");  
                // approach with while loop  
                int count = 0;  
                long now = System.nanoTime();  
                while (number != 0) {  
                     number = number / 10;  
                     count++;  
                }  
                System.out.print((System.nanoTime() - now) / 1000);  
                now = System.nanoTime();  
                double count1 = (Math.log10(Math.abs(temp) == 0 ? 1 : temp)) + 1;  
                System.out.print(": Timelogarithmic :" + (System.nanoTime() - now)  
                          / 1000);  
                System.out.println("");  
                range++;  
           }  
      }  

Output benchmark for 10 random numbers:-

 Number :279590619TimeWhile :2: Timelogarithmic :40  
 Number :878851661TimeWhile :1: Timelogarithmic :3  
 Number :1617859989TimeWhile :1: Timelogarithmic :3  
 Number :195513660TimeWhile :1: Timelogarithmic :7  
 Number :2024673675TimeWhile :1: Timelogarithmic :3  
 Number :478104225TimeWhile :1: Timelogarithmic :3  
 Number :417156389TimeWhile :1: Timelogarithmic :3  
 Number :-104604112TimeWhile :1: Timelogarithmic :3  
 Number :-516925116TimeWhile :3: Timelogarithmic :4  

The benchmark with Java program suggests that while loop approach of dividing the number by 10 each time gives a better response than using the inbuilt logarithmic and absolute functions.

See More :-
Game Of Pigs in C++
swapping two numbers without using the third one

Saturday, June 02, 2012

Utah Trip-Hike

Hike in Zion National park

 

Hikers :- Bishal Acharya, Nishikar Sapkota, Krishna Prasad Shrestha, Umang Amatya, Dinesh Bajracharya, Pinthep, Dinesh Kandel, Anjana Shakya, Sushma Tiwari, Eleeza Shrestha, Suchan lamichane

Gathering Venue : Ashton Park Apartment, Las Vegas Nevada
Departure Venue : Zion National Park, Utah
Departure Time : 6 am 

Notable moments :-

1. Breakfast at Subway : St George Utah
2. Hike to hidden canyon
3. weeping Rock
4. Emerald pool
5. Walk in the river
6. Lunch in National park
7. Dinner at Taco Bell  [Grilled Chicken Burrito]


This was supposedly the first hike of my life in USA. We were supposed to make a trip to Utah. On the outset of the trip, We were to gather at Umang's apartment in Ashton park. Although, I have been to numerous hike in Nepal, this counts as one of the special one because it was my first madain hike in USA. Witnessing Awesome terrain of Red Canyon and phenomenal landscapes marked the prelude of our trip. 

The most reminiscing part of our trip were almost a kilometer river walk and a two hour steep climbing up the hidden canyon. Although, most of us made to the mouth of the hidden canyon only three of us made to the arches [Nishikar, KPS & myself]

Some of the memories captured through photography :- 




















Returned back from the trip at 11 o'clock in the evening. Hope to go to Utah once again. This part of our trip was full of fun and adventure. Lets hope future has to offer us more :)

Other Trips
Los Angeles Trip April 2012
Utah Trip-Hike 2012
Into the wild - Chitwan national park 2011
Hike To Sarangkot and RSR 2011

साला यो नेताहरुले गर्दा डिप्रेसन जस्तो खतरा रोगनै लागिसक्यो


हेर्दा हेर्दै यी नेताहरुले संविधानसभा पनि भंग गरेरनै छाडे । मुलुकलाइ जैलेपनि भुमरी मा जाकेर आफ्नो टपरी भर्ने यी नेताहरुको अभिप्राय यसपाली पनि उदांगो भएको छ ।  के के न होला भनेर २०६२/६३ को आन्दोलन मा नाराबाजी लगायियो ? आखिर यहि नै हुनु थियो । वाक्क दिक्क लागेर नेपालमा कैले केहि नहोला जस्तो भएर विदेशतिर लागियो । जैले समाचार हेर्यो उही नेताहरुको गन्थन मात्र. लाग्छ कि यो देशमा यी फटाहा नेताहरु बाहेक अरु केहि पनि छैन । बिषेश खबर जैले पनि झगडा एक अर्का प्रति बिष बमन ।  न कुनै आर्थिक खबर न नै बिकास निर्माणका प्रसंग. घिनलाग्दो त्यहि पुरानो नेताहरुको अनैतिक बिचार र फोहोरी अनुहार । आज त केहि नयाँ समाचार होला भनेर पत्र पत्रिका खोल्यो उही दुई दुई ठाउँ चुनाब हारेको माधब नेपाल अर्का फेरी चुनाब हारेका तर भाग्य खुलेर कांग्रेश सभापति हुन पुगेका ८ क्लास पढेका अर्ध-सिक्षित सुशील कोइरालाको  भाषण, रमाइला कुरा गर्न माहिर तर जैले झुट को खेति गर्ने हाम्रा महान माओबादी अध्यक्ष श्री पुष्प कमल दाहालका जनतालाइ फेरी बेवकुफ बनाउने प्रसंगहरु । के यी व्यक्ति हरु मात्र हुन् नेपाली हरु को भाग्य मा ? कैले सम्म हामिहरुले यिनीहरुलाई सहनु पर्ने ? कैले सम्म यिनीहरु नै सर्वोपरी रहने ?  कैले सम्म हामीले दिनको सुरुवात यिनीहरुको अनुहार हेरर सुरु गर्नु पर्ने ? के नेपालमा नैतिकताको खडेरी लागेकै हो त ? कैले सम्म डिप्रेसन मा रही रहने हामी नेपाली जनताहरु ?

लोकतन्त्रको
स्थम्ब भनिने प्रेसको पनि कम हात छैन हामीलाई यो रोग सराउनमा भलै नेता भनाउदाहरु यसको जननी किन न  हुन् । हुन त २०६२-६३ तिर एक जना साथी ले मलाई भन्थियो नेपाल को उन्नति हुने वाला छैन तर आफु परियो आशावादी मान्छे, सोचिएको थियो कि नयाँ सामाजको बिकाशक्रमको नयाँ अध्याय सुरु भयो नेपालमा पनि तर अहिले आएर त्यो आशा को किरण बुझेर विकिरण मा परिणत भएको छ राम्रो को त के आशा गर्नु नराम्रो मा पनि संसार मै रेकर्ड कायम हुन पुगेको छ अहिले मेरो देश नेपाल ।

मैले त आशा मारी सके
। ९ अर्ब खर्चेर के के न गर्लान भनेर अर्ध सिक्षित, अनपढ, चुनाब हारेका, अनेकौ अपराध एवं भ्रस्टाचार मा लागेकाहरुलाई पनि स्थान दिएर संविधानसभा बनायोउ, अन्त्य मा हात्ती आयो हात्ती आयो फुस्सा । पैसा को त कुरा छाडीदिम, चार चार बर्ष अमुल्य समय खेर गयो, त्यो बितेको समय कसरी फर्काउने ? देश कति पछाडी धकलियो ? छ उत्तर कोइ नेताहरु संग ? एक त संसार कै सबै भन्दा गरिब भनाउदो मुलुक, त्यो समय कति मुल्यवान बन्न सक्थियो होला यदि राम्ररी सदुप्रयोग गर्न सकिएको भए ।

मेरो व्यक्तिगत बिमति नेताहरु संग मात्र हैन, नेपाली जनता प्रति पनि छ, देशको बर्तमान परिस्थितिको जिम्मेवारी हामी आफुले लिनु पर्दछ । फेरी पनि आउनेछन उही चुनाब हारेका बरिस्ठ नेता भनाउदा ढुलमुले माधब नेपाल, अर्का
पुर्व चुनाब हारेका सभापति सुशील कोइराला, १७ चोटी हारेका तर प्रधानमन्त्रीको जप अहिले पनि नछाडेका रामचन्द्र पौडेल, जनता ठगेका प्रचण्ड, धमिलो पानि पारेर अपराध को खेति गर्ने के पी ओली, बिचारको खडेरी परेका एवं बारम्बार पार्टी बिसर्जन गरेका विजय गच्छादार, सुडान काण्डका नाइके भिम रावल तथा कृष्णप्रसाद सिटौला, देवी प्रसादको चड्कन चाखेका झलनाथ खनाल, रुबेलकि सासु सुजाता कोइराला, भ्रस्टाचारमा चुर्लुम्म डुबेका मधेसी नेताहरु एवं अरु पार्टीका नेतारुपी भेष ओडेका ब्वाँसोहरु । खबरदार नेपालीहरु  बिगतमा जस्तै यसपाली पनि यी ब्वाँसोहरुको जालमा फस्योउ भने नेपाल र नेपालीहरुको भबिष्य अन्धकार बाहेक केहि हुने छैन । यिनीहरु फेरी पनि झूटको खेति गर्न पक्कै आउने छन् यदि फेरी यिनीहरुनै चुनिने हुन् भने हाम्रो सन्ततिहरुले हामीलाई कहिले माफ गर्ने छैनन् ।

अहिलेको पृष्ठभूमि एवं बिगतको कमीकमजोरीको समिक्षा गर्ने हो भने बास्तवमा जैलेसम्म हामी नेपालीहरुमा आफ्नो कर्मप्रति निष्ठा एवं व्यवहारप्रति नैतिकताको प्रस्फुटन हुदैन हाम्रो समाजको सुध्रिदिकरण एवं अग्रगमन सम्भब छैन। यो नै बिज्ञान हो । नैतिकताको खडेरी परेको यस मुलुकमा अहिले एकलब्य, युधिष्ठिर, मर्यादा पुरुषोत्तम श्रीराम जस्ता अग्रजहरुको जीवनी बाट पाठ सिक्नु अपरिहार्य बनेको छ । देशको प्रारम्भिक स्कूलदेखि बिश्वबिध्यालयसम्मको पाठ्यक्रममा नैतिक शिक्षा जस्तो बिषय राख्नु निवर्तमान समस्याको समाधानमा एउटा कडी हुन सक्छ । हालको शिक्षा प्रणाली बाट हटाईएको यस बिषयलाइ पुनर्स्थापना गर्नु को विकल्प छैन ।

अन्त्यमा  देशको
अवस्था जस्तोसुकै भएपनि आफ्नो जन्मभूमि आफुलाई प्यारो नै हुदो रहेछ, मेरो लेख पनि एक आम नेपालीको आफ्ना नेताहरुप्रतिको बितृष्णा मात्र हो, उनीहरुले हामि माथि गरेको कुठाराघातको आक्रोश मात्र हो । नेताहरुको प्रसङ्ग सुन्नै मन नपर्ने यस समयमा पनि नेताहरुको बारेमा लेख्नु पनि आफैमा बिरोधावासपुर्ण हुनसक्छ, पाठकहरु ले यसको समालोचन गर्नु होला  । जय नेपाल ।

Friday, June 01, 2012

Game of Pig program in C++

Game of Pig in C++


The following program simulates game of Pig between a human and a computer. Human player starts first and rolls a six faced dice. If the output of a dice is between 2 to 6, he is allowed to roll it again until he chooses to hold. If he holds then the total sum of his rolls is added to his total score and the turn is passed to the computer. If the output of the dice is 1 then his turn ends immediately and he earns a 0 score in this turn. Rolling a 1 after rolling any number wont let any points to add to his total..

When in computer's turn, It keeps on rolling until it's total sum of the rolls becomes greater than or equal to 20. The computer's score is then added to his total score. After this it stops and turn passes to human user. In between the roll if the computer rolls a 1 then his turn ends immediately without adding any points to his total score and the turn subsequently passes to the human user. 

This process continues until one of the user reaches a total score of 100 points at which it wins the game. This program is a simple console based C++ program which exits when any user reaches the total score of 100 or more first.

The program simulates Rolling of a dice by a generating a Random Number from 1 to 6 by using standard rand function of C++

  /**   
  * @author Bishal Acharya   
  * A simple program implementing Game Of Pigs where, first player   
  * to reach a total of 100 points wins the game.Players take a turn   
  * in rolling a dice containing six sides.   
  */  
 #include <iostream>  
 #include <ctime>  
 #include <cstdlib>  
 #define LIMIT 100  
 using namespace std;  
 class GameOfPigs1 {   
  public:  
  int randomRoll;  
  int humanTotal;  
  int computerTotal;  
  int turn;  
  int roll;  
  char select;  
  string wins;  
  void initialize(int value, int humanTotalScore, int computerTotalScore);  
  int humanTurn(int);  
  int computerTurn(int);  
  int getRandomNumber();  
 };  
 GameOfPigs1 gameObj;  
 /*constructor initializing turn to 0 means human turn */  
 void GameOfPigs1::initialize(int value,int humanTotalScore,int computerTotalScore){  
  gameObj.turn = value;  
  gameObj.humanTotal = humanTotalScore;  
  gameObj.computerTotal = computerTotalScore;  
 }  
 /* Function that handles single turn for human user*/   
 int GameOfPigs1::humanTurn(int humanTotalScore){  
    int tempScore = 0;  
    cout << endl;  
    cout << "**************************************************************" << endl;       
    cout << "Human Player's turn :" << endl;  
    cout << "Press r|R to Roll the dice or h|H to Hold :";  
    cin >> select;     
    while(select != 'h' || select != 'H'){       
      roll = gameObj.getRandomNumber();  
      cout << "Number Rolled by Human :" << roll << endl;  
      if(roll == 1){  
       tempScore = 0;  
       gameObj.turn = 1;  
       return 0;  
      }   
      tempScore = tempScore + roll;  
      cout << "Temporary Score of Human in this Roll is : " << tempScore;  
      cout << " | ";  
      cout << "Total Score if Halt :" << gameObj.humanTotal + tempScore << endl;  
      if(gameObj.humanTotal + tempScore >= LIMIT){  
       cout << "Human Wins. Hurray !"<< endl;  
       cout << "Computer Total :" << gameObj.computerTotal << " Human Total :" << gameObj.humanTotal + tempScore << endl;  
       exit(1);  
      }  
      cout << "Press r|R to Roll the dice or h|H to Hold :";  
      cin >> select;  
      if(select == 'h' || select == 'H'){       
       gameObj.turn = 1;  
       return tempScore;  
      }     
    }   
 }  
 /*Function that handles single turn for computer*/  
 int GameOfPigs1::computerTurn(int computerTotalScore){  
    int tempScore =0;  
    cout << endl;  
    cout << "**************************************************************" << endl;       
    cout<< "Computer's turn - Computer's Temporary Score for the turn : " << tempScore << endl;  
    cout << endl;  
    while(gameObj.turn == 1){  
    roll = gameObj.getRandomNumber();  
    cout << "computer rolled number :" << roll << endl;  
    if(roll == 1 && tempScore < 20){  
      gameObj.turn = 0;  
      cout << "Rolled 1 computerTotal is :" << gameObj.computerTotal << endl;  
      return 0;  
    }else if(tempScore >=20){  
      if(gameObj.computerTotal >= LIMIT){  
       cout << "Computer wins :"<< endl;  
       cout << "computer Total :" << gameObj.computerTotal << " Human Total :" << gameObj.humanTotal << endl;  
       exit(1);  
      }          
      gameObj.turn = 0;  
      return tempScore;  
    }   
    tempScore = tempScore + roll;  
    cout << "Temporary Score of Computer in this Roll :" << tempScore;  
    cout << " | ";  
    cout << "Total temporary Score of Computer :" << gameObj.computerTotal + tempScore << endl;  
    if(gameObj.computerTotal + tempScore >= LIMIT){  
       cout << "Computer wins :"<< endl;  
       cout << "computer Total :" << gameObj.computerTotal + tempScore << " Human Total :" << gameObj.humanTotal << endl;  
      exit(1);  
    }  
   }   
 }  
 /*Function that simulates a Random Roll of a dice*/  
 int GameOfPigs1::getRandomNumber(){   
  sleep(1);  
  return (rand()% 6) + 1;  
 }  
 int main(){   
  gameObj.initialize(0,0,0);  
  srand((unsigned)time(0));   
  while(true) {    
   if(gameObj.turn == 0){ // human turn  
   gameObj.humanTotal = gameObj.humanTotal + gameObj.humanTurn(gameObj.humanTotal);  
   cout << "HumanTotal after this turn is :" << gameObj.humanTotal << endl;  
   }  
   if(gameObj.turn == 1){ // computer's turn  
   gameObj.computerTotal = gameObj.computerTotal + gameObj.computerTurn(gameObj.computerTotal);  
   cout << "computerTotal after this turn is :" << gameObj.computerTotal << endl;     
   }    
  }   
 }  

Output of the given Program :-

gameOfPig



























Wednesday, May 16, 2012

My last team Building at Verisk - Into The Wild - Team Building Nov 26,2011 @ Chitwan National Park
















November 2011: early morning departure

On the outset of our trip to Chitwan National Park, I wake up quite early at 6 o’clock in the morning. I was forced to wait for an hour by Saroj in a chilly morning at kalimati. Eventually he arrived with some sort of
a crazy excuse of being late. Nevertheless, let’s begin our excursion with Santosh and Subhash dai being the ones to turn up at earliest in VIT premises. No surprises, there were few who would be late. Milan dai was the last one and made us to wait for some time. Here we are at VIT. Left Kathmandu one hour late than our scheduled time.

On the Pictures










Narayani sunset            
sunset
elephant safari chitwan

roof top at Narayani
canoe in Narayani river

collage jungle island resort

DSCF0608.JPG









The Collage

In the  Jungle

Elephant's
Ride

In
the Canoe

DSCF0608.JPG

jungle island resort

DSCF0608.JPG

Canoe in narayani River

Angry sudip



Group photo                     



DSCF0608.JPG

DSCF0608.JPG

DSCF0608.JPG

DSCF0608.JPG


On the trip we had a lot of fun apparently there were many Gorrila programmars on the bus. In the end after all the fun we had for two days, I felt that those two days we passed in Chitwan national Park were amongst the most memorable time of my entire life. Chitwan National park was well beyond my expectations. We enjoyed canoeing, elephants ride, jungle safari and beers in the night. Pratik, Saroj were the ones who were really high. I believe I was ok :)

Babins made a collage out of some pictures we took in the jungle. Evidently, he is seen in almost all photos.

Memorable events :-

Ashish  did not miss the show like previously
Pratik was very high follwed by Saroj
Poojan was the cheerLeader who also broke a cable wire from bus top
Missed Shamesh dai. He could not make it
Sudip splashed water at Rosy
Santosh was the Gump in the Forrest but a sleepy one
Tilak was attacked by the tiger when we were on the roof of the bus

Participants :- Navaraj awasti, Bishal Acharya, Santosh Pradhan, Eurika Manandhar, Rosy Sunuwar, Ashish Karki, Babins Shrestha, Milan Shrestha, Subhash Devkota, Biru Charan Sainju, Goonjan Shakya, Tilak Joshi, Sudip Agrawal, Niju Shrestha, Manish hada, Ram Kasula, Nitesh Bashnet, Priya Dangol, Bikesh babu Rajbanshi. (Engineers from Verisk Information Technologies)