Numbers guessing game

A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";
Felt like I need to win the lottery, and wrote this command so I train and develop my guessing abilities.
Sample Output
N between 1 and 100. Guess? 50
N between 1 and 50. Guess? 20
N between 20 and 50. Guess? 21
Took you 3 tries, Einstein

13
By: rodolfoap
2009-12-16 13:24:23

What Others Think

Heh, the first time I ran this the random number was 100 and I thought something was wrong with the logic. Neat.
deltaray · 666 weeks and 4 days ago
I used to want to become a programmer, but this is a difficult profession for me, so I did not go to work in this specialty, but simply made it my hobby. Now I make money using [url=https://csgobettings.com/lootbear/] lootbear promo code[/url] is a site where there are various top-end betting platforms. You can also try, you might like it, this is a very easy way to earn big money without leaving home.
Ablessairse · 130 weeks and 2 days ago
Ablessairse · 130 weeks and 2 days ago
Ablessairse · 130 weeks and 2 days ago
I used to want to become a programmer, but this is a difficult profession for me, so I did not go to work in this specialty, but simply made it my hobby. Now I make money using csgoempire.gg is a site where there are various top-end betting platforms. You can also try, you might like it, this is a very easy way to earn big money without leaving home.
Ablessairse · 126 weeks ago
My favorite guessing game is online casino games, especially these last days)) I found the perfect one for me at this site by reading numbers of reviews. I have chosen Grand Mondial casino, have you played it?
MaddisonFuller · 120 weeks and 6 days ago
Nachdem ich Ihnen von dem Online Casino https://online-roulett.at/roulette-echtes-geld-gewinnen/ erzählt habe, das ich schon lange spiele, werden Sie es auch besuchen wollen, da bin ich mir sicher. Behalten Sie daher den Link zu sich selbst oder gehen Sie sofort, um keine Zeit zu verschwenden.
Thicileares · 99 weeks and 1 day ago
I honestly find the contents to this platform super informative and interesting at the same time. It is called the platform of https://jocuri-casino.net/live-casino-romania. I highly recommmend everybody out there to check it out for once.
KayGasaway · 92 weeks and 5 days ago
As we all long for the day our lives can return to something approaching our old normality, GAA players across the country are hoping that the GAA will prove an exception. Xbox Emulator All this has been said countless times of course, but the frustrations bear repeating to highlight how farcical it has been for club players for so long.
hrihant · 91 weeks and 5 days ago
I managed to get an outstanding product or service right now, along with I aquired this device coming from a ?????? site that will my mate informed me with regards to. My spouse and i has not been ready for a good deal, nevertheless My spouse and i ended up being mesmerized by simply the standard of the product or service.
WalkerNolan · 88 weeks and 4 days ago
Demand for online casinos is increasing rapidly. Online many pages have information about online casinos but on https://free-slots-no-download.com/microgaming/41954-the-bounty/ it has a review of games like The Bounty Slot and online casinos to play for money. It had complete details of different slots, about their advantages and disadvantages, volatility, RTP, free spins, features. It had an option to play these slots for free for entertainment and fun.
BarbaraMJennette · 79 weeks and 4 days ago
At whatever point I figure out a brief period to mess around it normally doesn't take long until I discover something that makes me need to modify the game and improve it. Tom Cruise Jackets
heavenjennifer · 77 weeks and 4 days ago
Oh ja .. das Wachstum der Casinos wächst schnell und das ist so .. Spiele sind besonders beliebt casino-20-euro-bonus-ohne-einzahlung. Glaubst du, das ist ein guter Indikator oder nicht?
RileyMueller · 77 weeks and 1 day ago
Oh ja .. das Wachstum der Casinos wächst schnell und das ist so .. Spiele sind besonders beliebt [url=https://book-of-ra-slot.com/casino-20-euro-bonus-ohne-einzahlung/]casino-20-euro-bonus-ohne-einzahlung[/url]. Glaubst du, das ist ein guter Indikator oder nicht?
RileyMueller · 77 weeks and 1 day ago
[https://book-of-ra-slot.com/casino-20-euro-bonus-ohne-einzahlung/](https://book-of-ra-slot.com/casino-20-euro-bonus-ohne-einzahlung/) https://book-of-ra-slot.com/casino-20-euro-bonus-ohne-einzahlung/
RileyMueller · 77 weeks and 1 day ago
Oh ja .. das Wachstum der Casinos wächst schnell und das ist so .. Spiele sind besonders beliebt casino-20-euro-bonus-ohne-einzahlung. Glaubst du, das ist ein guter Indikator oder nicht?
RileyMueller · 77 weeks and 1 day ago
Your content is very used fully for me I want to appreciate this amazing stuff such a great content post I really impress this amazing stuff. Yellowstone Shop
Emmalynjohn · 75 weeks and 2 days ago
This types of wonderful blog, thanks for sharing this blog with us, Wood Suppliers
Emmalynjohn · 75 weeks and 2 days ago
I agree that the gambling industry is developing rapidly. Try 5 deposit casinos to choose the best casino for your needs.
ElizaE · 73 weeks ago
The best time for coffee breaks is the first half of the day throughout our energy and concentration is constantly falling Home Page. The later hour, the more difficult to restore these resources during a breaks. Studies show: To work more productive, it is better to choose from the office for a break at 11-12 o'clock, and not after dinner.
germainrene · 72 weeks and 6 days ago
Professional poker players are more and more turning into famous poker players.?????????123 And not just famous among other poker players: these professionals are turning into something like real celebrities. These becoming-famous poker players are turning Texas hold'em into a spectator sport.
jackson2321 · 69 weeks and 3 days ago
Greetings, I am certain that you have heard at any rate once in your life from a companion, a fantastic story of winning in an online club, or winning a bet. I figure you didn't actually confide in such bits of gossip, however imagine a scenario where I disclosed to you that this happened to me as well, and it profoundly completely changed me, when companion exhorted me this site - https://pokiefilter.com/ it is genuinely dependable and doesn't obstruct clients who genuine cash win.
JeremyYang · 68 weeks and 6 days ago
Nowadays online Betting has become a favourite pastime for many people. There are many online sites to do Betting but many are not safe to play or don't have many bonuses. My friend introduced me to [url=https://gg199.bet/en/esports]gg199.bet/en/esports[/url] They provide many games to bet on. The promotion package is really amazing and is really a safer way to bet, win money and enjoy the game. They have some cool bonuses for the participants as well.
BarbaraMJennette · 66 weeks and 4 days ago
Nowadays online Betting has become a favourite pastime for many people. There are many online sites to do Betting but many are not safe to play or don't have many bonuses. My friend introduced me to gg199.bet/en/esports They provide many games to bet on. The promotion package is really amazing and is really a safer way to bet, win money and enjoy the game. They have some cool bonuses for the participants as well.
BarbaraMJennette · 66 weeks and 4 days ago
I agree with you. I was one of those who didn't believe that I could win anything online. But today, everyone knows that online betting works! I am placing bets on https://www.betsofa.com/ . I like it. There are many sports disciplines that you can choose from that you like and understand the most. Enjoy!
Chris_1185 · 66 weeks and 2 days ago
This is the first time that I here in this blog, I found this types of great and valuable blog, I really I'm so Glad fully to read your article and I am also Bought a Jackets this trusted Online Platform Also check this out https://www.yellowstoneoutfits.com/.
Mable · 64 weeks and 6 days ago
This is the first time that I here in this blog, I found this types of great and valuable blog, I really I'm so Glad fully to read your article and I am also Bought a Jackets this trusted Online Platform Also check this out Yellowstone Outfits
Mable · 64 weeks and 6 days ago
I appreciate this blog very much, it has great information which is useful for every grep follower, especially since the best commands are collected here in one place. If you are looking for csgoroll referral codes you can find them here.
gassmat322 · 61 weeks and 4 days ago
Thanks for posting very useful information! I also would like to recommend the game platform betsofa .
Chris_1185 · 55 weeks and 1 day ago
Thanks for sharing this information to increase our knowledge. https://www.moneyheistmerch.com/
jessicajohn · 54 weeks and 6 days ago
Theft is condemned by society, but if you want to experience the feeling of being a thief, play Robbery Bob MOD APK (Unlimited Money, Unlocked All) – a funny game from the publisher Level Eight AB
jikond · 51 weeks and 6 days ago
Theft is condemned by society, but if you want to experience the feeling of being a thief, play Robbery Bob MOD APK (Unlimited Money, Unlocked All) – a funny game from the publisher Level Eight AB
jikond · 51 weeks and 6 days ago
but if you want to experience the feeling of being a thief, play Robbery Bob MOD APK (Unlimited Money,
jikond · 51 weeks and 6 days ago
I can say with confidence that here -http://crocasino.com, you can just play for fun without downloading and investing money, and just win a substantial amount in slots with bets.
JamesCarter123 · 48 weeks and 3 days ago
I can say with confidence that here - http://crocasino.com , you can just play for fun without downloading and investing money, and just win a substantial amount in slots with bets.
JamesCarter123 · 48 weeks and 3 days ago
Now there are many types of making money on the Internet, and I chose the easiest one, this is a game in a casino. I like excitement, and you can relax. I chose a casino on the Casinos X website. There is a list of top sites for the game. You can just go to them and look at the reviews for yourself, so it will be easier to choose))
Watkinsss · 43 weeks and 1 day ago
Columbus Slots to zabawna gra maszynowa oparta na Internecie, bez zaci?gu i ?adnych afirmacji SMS-owych. Korzystaj? z naszej strony internetowej kasyna, któr? mo?na znale?? na stronie SlotoZilla, graj? od tego momentu ca?kowicie za darmo i otrzymuj? mnóstwo energii, zak?ady i g?ówne niesamowite nagrody. Aby zagra? w ten obszar problemowy, wystarczy mie? dost?p do sieci, przeczytaj wi?cej szczegó?ów na temat automatów Columbus na naszej stronie https://www.slotozilla.com/pl/automaty/columbus równie? mo?esz gra? w darmowe automaty. Temat kosmiczny - podró?e oceaniczne w?drowca i ?wi?tego Krzysztofa Kolumba. Ta przyjemna maszyna do gier zaoferuje nie tylko wielbicielom oceanicznego sentymentu, ale oprócz planu, genialne ilustracje i wybory gier. Wielu ekspertów od gier lubi t? maszyn? hazardow? ze wzgl?du na jej kolejne i niezwyk?e nagrody pieni??ne. W ka?dym razie granie w Columbusa za nic jest nie mniej fascynuj?ce ni? za gotówk?. Jest szczególnie cenny dla adeptów. Do?wiadczenie zdobyte z nimi podczas gry b?dzie pó?niej cenne.
jackkok · 42 weeks and 3 days ago
If you are looking for a regular casino to start earning, I recommend this site https://jednoreki-bandyta.pl/. Here, you will find the best casinos in the country that offer good registration bonuses. Plus, you can try many slot machines for free on the site. This will help you gain experience in the games.
Watkinsss · 41 weeks and 4 days ago
Best Online Slots - https://reallybestslots.com https://reallybestslots.com
jackslots · 40 weeks and 4 days ago
Best Online Slots - https://reallybestslots.com/,
jackslots · 40 weeks and 4 days ago
https://reallybestslots.com
jackslots · 40 weeks and 4 days ago
Everyone loves to be given bonuses. Then I will delight you, as I found a list of casinos https://casinosanalyzer.com/free-slots-online/multiline on which, upon registration, they give a bonus for free spins. So you don't have to throw money but already play your favorite slots.
Watkinsss · 40 weeks and 3 days ago
You can play at the casinos https://casinoshrvatska.com/casino/spin-samurai/ anywhere since the mobile version allows you to do this from your phone. This is so convenient that today, while I was in a traffic jam, I earned a brand new phone.
profesor1 · 38 weeks and 2 days ago
You would visit
rahul · 35 weeks and 5 days ago
https://starmodapk.com/games/puzzle/
rahul · 35 weeks and 5 days ago
You may visit https://starmodapk.com/games/puzzle. I found so many games there like this.
rahul · 35 weeks and 5 days ago
Il n'est pas toujours facile de naviguer dans la jungle Internet à la recherche de sites et de jeux de casino en ligne réputés. Si vous cherchez un casino en ligne fiable, consultez mon blog. Les lois diffèrent d'un pays à l'autre. Il est illégal de jouer en ligne dans un casino canadien au Canada, cependant, il n'est pas illégal de jouer dans un casino étranger à partir du Canada. Oui, c'est contradictoire, mais c'est la loi.
FabriceFluet · 31 weeks ago
your article is really good and interesting i enjoyed reading it i will recommend you an app https://apksunny.com/six-guns/ Download six guns mod apk Latest version for free for Android. Become a cowboy and collect bonuses as you travel along the wild west.
zukenny · 28 weeks and 4 days ago
You may visit https://uberbrowse.com/category/blog/. I found so many informative there like this.
dolores924 · 26 weeks and 1 day ago
You may visit https://uberbrowse.com/category/blog/. I found so many informative there like this.
dolores924 · 26 weeks and 1 day ago
Subway Surfers Mod Apk is amazing running gameplay where the policeman is chasing you. You can escape from the police and by choosing characters as the speed is very good and you can have unlimited money. The game is so interesting to play the graphics are amazing. click herte to download: https://apkshut.com/subway-surfers-mod-apk/
mrpollard · 19 weeks and 3 days ago
Subway Surfers Mod Apk is amazing running gameplay where the policeman is chasing you. You can escape from the police and by choosing characters as the speed is very good and you can have unlimited money. The game is so interesting to play the graphics are amazing. Subway Surfers Mod Apk
mrpollard · 19 weeks and 3 days ago
This interactive game is something that allows you to make new friends as well as interact with new people. In addition to this you get to explore a bunch of different worlds. Download the Roblox MOD APK version for better and better features. Roblox Mod APK
polard123 · 19 weeks and 2 days ago
I love playing different games, especially at casino sites. But the most important thing is to find good [url=https://btccasinos.top/deposit-bonuses/]deposit bonuses[/url]
JackLite · 15 weeks and 2 days ago
Thanks for your information . You can go to APKCima application to experience the hottest games with many new functions https://apkcima.com/
LamarHudson · 13 weeks and 5 days ago
Tenho uma empresa de apostas favorita e quero mencionar o rivalo app , acho que cada jogador concordará comigo que um aplicativo móvel para uma empresa de apostas é muito útil e, neste caso, também tem uma interface legal e acesso fácil a todo o portfólio de apostas e jogos esportivos! Este site não é muito conhecido, então talvez você ainda não tenha ouvido falar dele, mas a razão não é que seja de baixo nível, apenas que poucas pessoas querem compartilhar sites realmente decentes!
gisby87 · 10 weeks and 1 day ago
Computers excel at giving feedback, and the payoff for any action is typically extremely clear. A key outcome of this is a huge intolerance on the part of the younger generation for things that don't pay off at the level expected. twitchviral.com
kenwood · 8 weeks and 6 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale pug puppies indiana Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
rahimhh21 · 3 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: