Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making my first Android app (and got stuck)

 
Silviu Stelian
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody

I just started developing apps for Android in Eclipse and I came upon an interesting challenge. I started working on an application that:
When launched, shows an input field to enter a sentence and a 'Process' button
When 'Processed' button is pressed, the application shows the same sentence (pretty easy so far right? ) with the following modifications:

The first and last letter of each word is kept the same while all other letters (if any) are randomly mixed.

And here is where I got stuck as I have no idea where to begin doing it.

Thanks and keep coding
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this might of some help.

http://www.java-forums.org/new-java/3852-word-scramble.html
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silviu Stelian wrote:
And here is where I got stuck as I have no idea where to begin doing it.


Can you show the code you have so far & what is the error/logic problem you are getting? That might be helpful in answering the question

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about how to write a method that scrambles the letters in a word, all but the first and last letter? If so, that has nothing to do with Android specifically; it is a basic Java algorithm (think shuffle sort)

By the way, I wrote that exact method many years ago. The idea comes from some research someone did that even if you misspell words in that way that the reader can still understand what you wrote. I'll post the link when I find it - it is in the comment of the class that implements this method. (Well, the comment didn't contain the URL, but I did find this: http://www.douglastwitchell.com/scrambled_words.asp. There is also evidence that this was a hoax, that no such research was done.)

No, I will not post my code. But I would be happy to discuss and critique your algorithm for how to do this. It really is a simple algorithm. Though I have to admit that my algorithm was not optimized - I used it as part of a mock performance test so making the JMV work a little harder was part of my goal.
 
Poparlan Stefan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silviu Stelian wrote:Hello everybody

I just started developing apps for Android in Eclipse and I came upon an interesting challenge. I started working on an application that:
When launched, shows an input field to enter a sentence and a 'Process' button
When 'Processed' button is pressed, the application shows the same sentence (pretty easy so far right? ) with the following modifications:

The first and last letter of each word is kept the same while all other letters (if any) are randomly mixed.

And here is where I got stuck as I have no idea where to begin doing it.

Thanks and keep coding

have you finished this project?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, methinks that Poparlan and Silviu are taking the same class and are asking us to do their homework...

Note that we are NotACodeMill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic