• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Making my first Android app (and got stuck)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this might of some help.

http://www.java-forums.org/new-java/3852-word-scramble.html
 
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic