webOS Nation Forums >  Homebrew >  webOS Homebrew Apps > Hangman v1.2 [was v1.0] (7/29)
Hangman v1.2 [was v1.0] (7/29)
  Reply
 
Thread Tools Display Modes
Old 07/11/2009, 08:41 PM   #1 (permalink)
Member
 
palmdoc#AC's Avatar
 
Posts: 1,815
Here's another one to pad the Homebrew numbers
One of the things I note about the homebrews coming out is - what, no Hangman app? So here's the obligatory hangman app, and no credit to me, code "adapted" from here

Obligatory screenshot:



Update v1.1:
Word list - Countries of the World
Graphics resized and duplication of the middle table fixed - thanks to rboatright
Link to author's website

Update v1.2:
Reformatted by Colonel Kernel (see post)
Attached Files
File Type: ipk palmdoc.webhangman_1.1_all.ipk (242.7 KB, 911 views) Email Attachment
Download URL:
File Type: zip webhangman.zip (293.2 KB, 59 views) Email Attachment
File Type: zip webHangman_1.2.zip (53.6 KB, 57 views) Email Attachment
File Type: ipk palmdoc.webhangman_1.2_all.ipk (29.1 KB, 845 views) Email Attachment
Download URL:
__________________
Check out my My Medical webOS Apps
Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News

Last edited by palmdoc2005; 07/25/2009 at 08:51 PM.
palmdoc#AC is offline   Reply With Quote
Old 07/11/2009, 09:01 PM   #2 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
It may not be kosher, actually.

From the page's source code:
"/*
Mastering JavaScript, Premium Edition
by James Jaworski

ISBN:078212819X
Publisher Sybex CopyRight 2001
*/"

But I found a better version that is also GPL here:

http://janmulder.com/scripts/hangman/
Colonel Kernel is offline   Reply With Quote
Old 07/11/2009, 10:15 PM   #3 (permalink)
Member
 
tripsbacks's Avatar
 
Posts: 337
Cool! Thanks.
tripsbacks is offline   Reply With Quote
Old 07/12/2009, 12:05 AM   #4 (permalink)
Member
 
palmdoc#AC's Avatar
 
Posts: 1,815
Quote:
Originally Posted by Colonel Kernel View Post
But I found a better version that is also GPL here:

Jan Mulder
Updated it and included the source files if anyone wants to clean up the code.
__________________
Check out my My Medical webOS Apps
Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News
palmdoc#AC is offline   Reply With Quote
Old 07/12/2009, 12:59 AM   #5 (permalink)
Member

 
Posts: 6,869
Just out of curiosity, how big of a word list does this have for games?
jhoff80 is offline   Reply With Quote
Old 07/12/2009, 01:05 AM   #6 (permalink)
Homebrew Developer
 
milominderbinde's Avatar
 
Posts: 4,491
Thank you!

This is great work. Homebrew is exploding!

I could not help but notice that Jan Mulder has 4 other js apps sitting there as well...
Crossword
Wordsearch
Memory Squares
Slider Puzzle


Or how about converting any of the js script games over to the Pre?

The JavaScript Source: Game Scripts

Or how about these calculators?

Math Related Scripts : The JavaScript Source or these:

JavaFile.com - free java scripts, java applets!

- Craig
__________________
- Milo
Getting StartedRingtonesVideos/MoviesPatches/ThemesMusic Player(Remix)
Battery LifeBackup/SyncingGreat Signal-AiraveiPhone ThemeForum Guidelines

Last edited by Milominderbinder; 07/12/2009 at 10:52 PM.
milominderbinde is offline   Reply With Quote
Old 07/12/2009, 02:02 AM   #7 (permalink)
Member
 
rboatright's Avatar
 
Posts: 550
you need to resize your graphics. The Yourscore/myscore image is 300 the NEW button is 52. the pre's screen is only 320 px wide.

This hunk of code
Code:
document.writeln(
  '<TABLE border="1" bgcolor="#CCCCCC" cellspacing="'+cellDimension+'" cellpadding="'+cellDimension+'"><TR>'
  +'<TD background="'+sourceDir+'newbtn.gif" width="'+imgWidth+'" height="'+imgHeight+'">
    <A href="javascript:void(newPuzzle())">
    <IMG border=0 SRC="'+sourceDir+'space.gif" width="42" height="22" alt="new puzzle"></A></TD>'
  +'<TD background="'+sourceDir+'scores.gif" >'
  +'<IMG border=0 SRC="'+sourceDir+'space.gif" width="90" height="10"><input type="text" size="5" name="you" value="0">'
  +'<IMG border=0 SRC="'+sourceDir+'space.gif" width="90" height="10"><input type="text" size="5" name="me" value="0"></B></TD>'
  +'</TR><TR><TD colspan=3 bgcolor="#FFFFFF" align="center">');
at line 436, calls for a table row which has a td with
newbtn.gif (52 px) as a background,
overlaid with space.gif expanded to 42ps x 22px,

then another td with scores.gif as a background (300px) overlaid with
space.gif expanded to 90px x 10px, then a 5 character input field for your score,
then another 90px of space, followed by another 5 character input field for the computer's score.

That adds up to more than the screen's width, so the line wraps, the backgrounds are repeated, and the computer's score box falls onto the next line.

So, the SIMPLEST answer is to edit lines 440 and 441 reducing the size of the spacers until the wrap stops.

but you MAY have to use some utility to resize newbtn.gif and scores.gif as well. (and should.) in order to keep the input fields lined up with the words.

it would be good as well to increase the word-list at the top of the code. at present your word list runs from line 68 to 94. -- 26 words. You could paste in the word lists from the uncalled countries, fruitnveg and jobs html files into the index.html (and get rid of the other files which will never execute.) That would get you another 100 words or so.

expanding the list beyond that is some small work, because each word requires a hint.
rboatright is offline   Reply With Quote
Old 07/12/2009, 02:04 AM   #8 (permalink)
Member

 
Posts: 6,869
I tried this out and it's decent, but the buttons are so small that they're pretty much unusable. You'd probably be better off getting rid of them entirely and just using the keyboard, if you do more work on this.
jhoff80 is offline   Reply With Quote
Old 07/12/2009, 02:05 AM   #9 (permalink)
Member
 
rboatright's Avatar
 
Posts: 550
in regard to milominderbinde's suggestion about porting js apps,

Please Pretty Please pay attention to the copyright on apps, and only port apps which have licenses which allow you to do so. Don't port apps which say clever things like "all rights reserved." If an app includes a bsd or mit or gpl license, you're pretty much golden, but PLEASE remember to give credit on the screen, in a help page or an about page.
rboatright is offline   Reply With Quote
Thanked By: Milominderbinder
Old 07/12/2009, 02:08 AM   #10 (permalink)
Member
 
rboatright's Avatar
 
Posts: 550
Quote:
Originally Posted by jhoff80 View Post
I tried this out and it's decent, but the buttons are so small that they're pretty much unusable. You'd probably be better off getting rid of them entirely and just using the keyboard, if you do more work on this.
Accepting keyboard input will be a non-trivial modification to the program.

The current version is written in spaghetti javascript. The author, instead of attempting to interact with the DOM, simply builds the entire web page each time it's updated. (ouch.) Moving this to a standard Pre-app and not a straight web port will also be non-trivial.

For an outline of a "Mojo-ization" porting process, take a look at pre dev wiki: Porting Older Apps
rboatright is offline   Reply With Quote
Old 07/12/2009, 02:13 AM   #11 (permalink)
Member
 
Posts: 315
what is the point of porting all these apps if your not making changes to them. is the user experience different than just bookmarking it and playing it as a webapp?

I ask this because at my high school I have acess to a ton of html/javascript games that kids have created over the years and I could "port' them
__________________
The Mx Web
kmax12 is offline   Reply With Quote
Thanked By: Milominderbinder
Old 07/12/2009, 02:32 AM   #12 (permalink)
Member
 
rboatright's Avatar
 
Posts: 550
Well said kmax12.

If you're going to port an app to the pre, you should go through the work to actually port it. Dumping an index.html into a folder is not porting.

At a minimum, graphics need to be re-sized and a menu should be created for an about page.
rboatright is offline   Reply With Quote
Thanked By: Milominderbinder
Old 07/12/2009, 02:38 AM   #13 (permalink)
Member
 
Posts: 65
Hangman is cool, but I have been looking for an Air Hockey game, maybe even one to connect to other pre's for a vs. game
__________________
To Honor With Dignity- USAF Honor Guard
e1allen is offline   Reply With Quote
Old 07/12/2009, 02:51 AM   #14 (permalink)
Member
 
palmdoc#AC's Avatar
 
Posts: 1,815
Quote:
Originally Posted by kmax12 View Post
what is the point of porting all these apps if your not making changes to them. is the user experience different than just bookmarking it and playing it as a webapp?

I ask this because at my high school I have acess to a ton of html/javascript games that kids have created over the years and I could "port' them
Actually it is to see how JS script apps will run on the Pre itself and not the browser, and basically as a learning experience for JS noobs like me.
I learn from the examples and the useful comments and criticism here.

Cheers
__________________
Check out my My Medical webOS Apps
Featured free apps: DrugView | Eponyms | eMed | Dosecalcfree | Beeb News
palmdoc#AC is offline   Reply With Quote
Old 07/12/2009, 10:42 AM   #15 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
Quote:
Originally Posted by kmax12 View Post
what is the point of porting all these apps if your not making changes to them. is the user experience different than just bookmarking it and playing it as a webapp? ....
For me, 40 minutes of my subway commute each day is underground, out of reach of cell towers. So, in that way, yes.

I don't have a problem with drag-and-drop ports because, 1) it gets the app functional (for the Dev and users) and 2) the app will improve and grow, becoming a proper webOS app with time.
Colonel Kernel is offline   Reply With Quote
Old 07/12/2009, 10:51 AM   #16 (permalink)
Member
 
rboatright's Avatar
 
Posts: 550
and let's not forget airplane time.
rboatright is offline   Reply With Quote
Old 07/15/2009, 12:23 AM   #17 (permalink)
Homebrew Developer
 
milominderbinde's Avatar
 
Posts: 4,491
Quote:
Originally Posted by kmax12 View Post
what is the point of porting all these apps if your not making changes to them. is the user experience different than just bookmarking it and playing it as a webapp?

I ask this because at my high school I have acess to a ton of html/javascript games that kids have created over the years and I could "port' them
As we are watching the Homebrew forum often the first beta is just a port. Then an explosion occurs over the next hours and days and the app grows.

That is the wonder of this open source environment.

Dozens of people chime in with ideas and even sample code and solutions. There is no better way to learn than in a hands-on lab this.

- Craig
__________________
- Milo
Getting StartedRingtonesVideos/MoviesPatches/ThemesMusic Player(Remix)
Battery LifeBackup/SyncingGreat Signal-AiraveiPhone ThemeForum Guidelines
milominderbinde is offline   Reply With Quote
Old 07/15/2009, 03:48 PM   #18 (permalink)
Member

 
Posts: 6,869
Not to be so negative about it, but the internal structure is a mess. I mean, I know that the files are small, but inside that ipk you've got a zip of the application code (and that zip includes the ipk), another copy of the ipk, and an index.html and a index - copy.html. Plus, there's two other categories in html files that aren't ever even called by the application so they're completely unnecessary. I'd take the advice of whoever said it above and combine all the html files / word lists into one.

But anyway, wouldn't it make more sense to clean things up a bit and get rid of the unnecessary crap before packaging it into an ipk?

But, the actual app does look nicer than the last version with the two lines for scoring bug that had.

Last edited by jhoff80; 07/15/2009 at 03:54 PM.
jhoff80 is offline   Reply With Quote
Old 07/15/2009, 04:16 PM   #19 (permalink)
Member
 
Colonel Kernel's Avatar
 
Posts: 775
The internal structure is SO bad that to do all that first would delay the launch of the app. So as it is, it's there and functional.

I working on an update that I'll be posting hopefully tonight or tomorrow.
Colonel Kernel is offline   Reply With Quote
Old 07/15/2009, 10:25 PM   #20 (permalink)
Member
 
Posts: 10
Is there anyway this can be a multiplayer game, like one person input the word and the next player try to guess the word?
mitchds is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0