I am learning VBA and I am fond of word games such as Text twist and Spellathon. When I was at IIT Delhi, I used to play a game by the name "Jumble fever" (using DC++ , Ptokax and lua scripts etc). I was looking forward to downloading similar game from the internet however I couldn't find any to my satisfaction. The problem with text twist and spellathon is that they are limited to words of 7 or 8 letters (and you can't customize them with your own words) . So I thought I might as well write my own code in excel for doing something similar to "Jumble fever" using excel (Why excel,... well I came across a cool GRE worlist game written in Excel by someone called simran somewhere in US, loved it,-- it was customizable with your own words, you could even use it to learn foreign vocabulary. That program is available here: http://simran.crownpac.net/blog/wp-content/plugins/download-monitor/download.php?id=1). The first step I needed was to develop a code for randomizing any given string. Of course I am yet to develop the entire game but the first part (randomizing of a string) is over. (It took me whole day to develop just this much code, I am a dummy in VBA). Feeling very happy about the code. So here it is for benefit of anyone around the world. (BTW if you have anything with the functionality similar to Jumble fever for a standalone PC please do share with me). (Spellathon is also a cool game and can be downloaded from here: http://www.freewarefiles.com/Spellathon_program_49479.html )
Here's the code:
(VBA CODE to RANDOMIZE ANY GIVEN STRING in EXCEL)
---------------------------------------------------------------------
Function randomize(s)
newstr = ""
sl = Len(s)
For i = 1 To sl
strlen = Len(s)
c = Application.RandBetween(1, strlen)
ch = Mid(s, c, 1)
newstr = newstr & ch
s = Application.Replace(s, c, 1, "")
Next i
randomize = newstr
End Function
---------------------------------------------------------------------
How to use this code:
Open the developer VBA window in excel (alt +F11)
Insert New Module
Copy and Paste the above code (between the dashed lines)
Now you can use the "randomize" function in excel just as any other function (such as len etc). For example randomize("ambarish") may output "hsirabma"
Hope you like it.
Comments are welcome.
(I wrote this code and posted it on the net because even after an extensive google search I could not come across a VBA function in excel to do such a seemingly simple task).
This blog is about me and my life. I write to relieve my stress, plan, learn from my own mistakes and share something which touches my heart/ is humorous/ is motivational. I shall scribble out here whatever comes to my heart. This is what I do with my diary as well. Currently I am working as a professor of physics and Acting Center Coordinator at FIITJEE Faridabad
Blog Archive
-
▼
2010
(330)
-
▼
May
(148)
- My daughter is your reward
- Which is the favorite subject of IIT Aspirants: Po...
- Hopes Beyond IIT
- IIT JEE Pre-Preparation strategy for class XIth st...
- What should be the strategy for repeaters for IIT ...
- 3 Steps Preparation for IIT JEE
- What should be the strategy for repeaters for IIT ...
- Roles of Coachings in IIT JEE selection
- Are IIT-JEE toppers role models? Or just Models?
- Tips to ace the IIT-JEE 2010
- FIITJEE FORTUNATE 40
- FIITJEE excels in IIT training
- FIIT-JEE set to scale up operations
- FIITJEE's Profile at Naukri.Com
- Study at FIITJEE , India | Studyplaces
- IIT topper in TN did not miss an IPL match
- PEs pump in $140 million in education since Jan 2010
- Play schools scout for Private equity investors
- FIITJEE records 33 % success rate in IIT entrance ...
- FIITJEE to open 60 schools in next two years
- STG inks MoU with Top Chalks
- Notice to IIT-JEE chairmanSTAFF WRITER 22:28 HRS IST
- Free Service to Get Solved Your IIT, JEE and AIEEE...
- Ahmedabad boy secures 29th rank in IIT-JEE
- Ahmedabad boy secures 29th rank in IIT-JEE
- Girls top board exams, but fall short beyond
- Over 150 crack IIT-JEE , big boost for city
- Boys are much more intense about IIT-JEE’
- Kota magic missing this year
- Cobbler's son cracks IIT-JEE
- Delhi IIT-JEE topper is just 14 & homeschooled - D...
- City students fail to make it to IIT-JEE top 100
- Last minute preparation tips for IIT JEE | IITJEE ...
- My take on VMC's selection rates
- Kota opposes IIT cutoff proposal
- Top 10 ranks elude Kota
- World class schooling
- Heard from the grapevines IIT JEE result 2010: Ple...
- Boy from Madras zone tops IIT-JEE- Hindustan Times
- Availability of Courses at various IITs
- IIT JEE 2010 Mathematics Syllabus
- IIT JEE 2010 chemistry syllabus
- IIT JEE 2010 Physics Syllabus
- CORRECTIVE MEASURES FOR THE ERRORS ENCOUNTERED IN ...
- IIT-JEE Ranking Procedure
- Who would be the topper in IIT JEE 2010?
- GRE Jumble for IIT LANs : A game by Ambarish Sriva...
- IITJEE 2006 - VMC, Delhi and Bansal, Kota Hit Hard
- Is this the end of Coaching Institutes?
- Coaching factories in Kota badly hit
- Why the IIT-JEE pattern was changed
- Delhi coaching centres restrained from charging fe...
- Developing a New Jumble Word Game in Excel.
- Students Preparing For IIT JEE Need Coaching
- Should JEE 2010 be conducted again due to several ...
- Last Mile: Some Tips for IIT JEE 2010 Examinees
- Corrective Measures for the Errors in JEE-2010: An...
- Do You Hate Someone? (Story) A VERY NICE STORY WIT...
- Branchwise Opening and closing ranks for different...
- IIT JEE 2009 cutoffs
- Not joined any other
- Death Ends Fun: Mine, mine!
- QUESTION ME NO MORE : From Nitin Jain's book: My s...
- LIFE AT IIT AND BEYOND
- Nitin Jain: Secret of my Success : Preface
- Nitin Jain's book: The Secret of My Success: About
- Nitin Jain’s Book “My SUCCESS Story” will be Relea...
- Just in case you need a laugh:
- Few good jokes/ oneliners
- Advance notice
- Joke: Check and shoot
- Speech Openers.....
- Giving feedback - The CAMEL - DONKEY syndrome !
- Speech Openers.....
- Practise your punch line !
- My struggle with grammar.
- What makes a great speaker ?
- Humor in real life !
- Well crafted and delivered... but....
- Some thoughts on ADVICE
- witty oneliners from dorothy parker
- Catchy Signs !
- Benefits of using humor in public speaking..
- Still more Speech Openers
- Repartee or witty retort
- Think it over
- Think it over !
- ARABIC PRAYER
- Put it before them BRIEFLY so they will read it
- Warren Buffet's advice on writing : Be simple, cle...
- From Chendil Kumar's blog: Spontaneous Speech Openers
- From Chendil Kumar's blog: Liked it: beautiful and...
- Ex FIITJEEan Civil Services Rank 2 : Prakash Rajpu...
- FIITJEE's Talent Reward Exam on May 16 for IIT-JEE...
- Delhi High Court admits plea to stay IIT-JEE result
- Nitish demands IIT-JEE re-test
- Delhi High Court Admits Petition to Put Stay on II...
- Super 30 demands fresh IIT-JEE, rejects remedial s...
- 44 Ways to Ruin Your Financial Life By Age 30
- How to Behave When Another Cyclist is Hurt
-
▼
May
(148)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment