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