Jump to content


Photo

Alien Calculator


  • Please log in to reply
57 replies to this topic

#1 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 December 2005 - 09:54 AM

I cant remember if I mensioned but before a PDA were to be put in the game it'd be neat if there was a JAVA version on the website. Anyway before doing that, I think for practise and to work out the kinks it might be neat to create a simple alien electronic calculator simulator as a JAVA thingie first. It'd be a lot simpler than a PDA simulator, it could generate interest through geek-appeal and we might learn from the process of making it.

I have some ideas already.
First rather than having all 64 numbers on there it has:
0, 1, 2, 3, 4, 8, 16, 24, and 32, from these you build the numbers. We should just make it a basic + - x / ^ sto rcl

What do you think?
Posted Image
I'm starting to like the heavy cannon more and more.

#2 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 20 December 2005 - 09:58 AM

I agree, having all 64 numbers would be cumbersome and not very practical.

#3 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 20 December 2005 - 11:11 AM

I agree, having all 64 numbers would be cumbersome and not very practical.

<{POST_SNAPBACK}>

Well, it's not that I'm against a alien calculator, but Aliens might calculate a lot in their heads, and if not, they might have something more sophisticated then a calculator with a keypad. I think they would use sth. with a brain interface, no? Or did I get this wrong and this is for the X-Corps troops?
Well, nevermind. It's not really speaking against a calculator as a toy for us, just if we want to fit it in the game as an alien artefact (v1+ or bonus) we might see us confronted with ome problems explaining it.
On the technical side I agree with you - but you don' need the 3, so why use it?
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#4 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 December 2005 - 12:51 PM

There'd be no calculator in the actual game this is mainly for working out kinks, getting practise, and generating some interest.
Posted Image
I'm starting to like the heavy cannon more and more.

#5 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 20 December 2005 - 01:06 PM

There'd be no calculator in the actual game this is mainly for working out kinks, getting practise, and generating some interest.

<{POST_SNAPBACK}>

oh got it all wrong then. sorry.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#6 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 22 December 2005 - 12:37 PM

Okay here's a simple keypad concept:
Posted Image

1,2,3,4
8,16,24,32
0, . , Enter
+, -, *, /
^, Store, Get, Swap
Posted Image
I'm starting to like the heavy cannon more and more.

#7 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 23 December 2005 - 03:49 PM

Nice! although I can't read a thing...
What's the meaning of the third row? You only translated three "icons".
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#8 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 23 December 2005 - 04:38 PM

Each glyph is a syllable, "Enter" is two syllables.
Posted Image
I'm starting to like the heavy cannon more and more.

#9 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 23 December 2005 - 04:39 PM

I think the calculator should be in RPN as well; that's the "1,enter,1,plus" type rather than "1,plus,1,equals" type.
Posted Image
I'm starting to like the heavy cannon more and more.

#10 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 23 December 2005 - 05:13 PM

Each glyph is a syllable, "Enter" is two syllables.

<{POST_SNAPBACK}>

So, shouldn't you make the "enter" buttons one instead of two? or would you have to press both buttons in order to hit enter?

#11 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 23 December 2005 - 05:34 PM

It is one wide button.
Posted Image
I'm starting to like the heavy cannon more and more.

#12 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 23 December 2005 - 05:54 PM

It is one wide button.

<{POST_SNAPBACK}>

Oh, sorry, didn't notice that. I like it :)

#13 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 23 December 2005 - 07:05 PM

Okay, now I'll try to come up with an output display concept. Then the artists in our little group inspired by those can come up with a visual for the whole thing.
Posted Image
I'm starting to like the heavy cannon more and more.

#14 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 07 February 2006 - 09:10 PM

Well guys, it took me some time, but I managed to come up with a very simple Alien Calculator. Until now, one has to feed it with decimal numbers, it is only able to add two numbers and it's not designed to calculate big numbers (it can only display two Alien digits, so maximum is "63|63"(which is sth around 4096 - which is not working so, last safe working number was 4094 if I'm not mistaken - whyever). Nevertheless, it's a start :)
Have a try and tell me what you think.

Edited by Mad, 07 February 2006 - 09:20 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#15 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 07 February 2006 - 09:32 PM

Thats pretty cool! It craps out for sums larger than 62 though.
Posted Image
I'm starting to like the heavy cannon more and more.

#16 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 07 February 2006 - 09:36 PM

Nice!

#17 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 08 February 2006 - 04:02 AM

It craps out for sums larger than 62 though.

<{POST_SNAPBACK}>

It does? Damn! How do you define "crap out"? That it writes two digits for sums bigger then 62 is the way it's thought to work. Maybe I got the Alien numbering wrong, but I thought, we do this like this: one digit for 0-63, if the Number is bigger then 62, two digits are used. For a 63 this will be a 1 followed by a zero (1*63 + 0 = 63), for 64 a 1 followed by a 1 (1*63 + 1) and for 129 a 3 followed by a two (2*63 + 3) etc etc...

Edited by Mad, 08 February 2006 - 04:02 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#18 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 08 February 2006 - 11:38 AM

Nope 64=10.
Posted Image
I'm starting to like the heavy cannon more and more.

#19 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 08 February 2006 - 03:04 PM

Nope 64=10.

<{POST_SNAPBACK}>

can't work this way. then they would have 65 digits. This would be Base 65 then, wouldn't it? Remember, you have to start counting with the zero - Dual-System is base 2 - you use zero and one. (I mean, it's no problem to change it, just thought we would use 64 Symbols... )

---Edit---
yes, exactly like you said! 64 = 1 0. Sorry. Fixed in the new version. At least I hope so.. . :)

Edited by Mad, 08 February 2006 - 06:37 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#20 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 08 February 2006 - 06:31 PM

Ok, here is a new, much more powerful version. It is able to add, substract, multiply and divide all numbers fitting into the "Integer" data type. Meaning: you can use numbers up to 4000000000. I think this should be sufficient... :)
It has a few bugs though (like not displaying a zero if the result is 0) but I'm just too tired to fix this right now. I will handle this in the next days. :) Until then... enjoy... :)
Again, I would be happy if you could post any bugs you encounter (especially wrong results!!!). Thanks :)

---Edit---
Could not sleep with the zero issue... fixed... :)
Should be without any bugs now.

Edited by Mad, 08 February 2006 - 06:53 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#21 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 10 February 2006 - 08:20 AM

Okay, now I'll try to come up with an output display concept.  Then the artists in our little group inspired by those can come up with a visual for the whole thing.

<{POST_SNAPBACK}>

How far are you with this? I think, I'm more or less done with the calculator, only thing missing is a "GUI" and the fitting routines...

---Edit---
Oh, and it would be cool, if every "button" is a JPEG on it's own, 'cause I intend to realize the input with an "onclick" routine. :)

---Edit2---
wohoo post #500 :party:

Edited by Mad, 10 February 2006 - 08:24 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#22 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 10 February 2006 - 05:26 PM

Okay lets begin with the input panel. I'll make a negative color version of it to represent a pressed button. I'll come up with a functional description of it. In the mean time look up RPN calculators, there are some online simulators of HP RPN calculators. RPN is the 1-enter-1-plus variety rather than 1-plus-1-equals.
Posted Image
I'm starting to like the heavy cannon more and more.

#23 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 10 February 2006 - 05:56 PM

Okay lets begin with the input panel.  I'll make a negative color version of it to represent a pressed button.  I'll come up with a functional description of it.  In the mean time look up RPN calculators, there are some online simulators of HP RPN calculators.  RPN is the 1-enter-1-plus variety rather than 1-plus-1-equals.

<{POST_SNAPBACK}>

That is exactly what I wanted to do, because, I think something like this will be the only way to go, if we don't want 64 numbers on the input panel... Nevertheless, I thought of something in the way of 1-enter-plus-1-enter, because it's more intuitive, isn't it?

---Edit---
Ok, I checked on RPM, and I must say, though this is fascinating I prefer the Algebraic method. Nevertheless, because it's much easier to code... :Blush: (javascript doesn't know stacks)

Edited by Mad, 10 February 2006 - 06:07 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#24 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 10 February 2006 - 06:08 PM

Engineers use RPN I figured the aliens . . . .


Posted Image


Okay let me draught-up a description; hang on.

We'll just do a stack depth of two with one store.
Posted Image
I'm starting to like the heavy cannon more and more.

#25 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 11 February 2006 - 02:45 AM

We'll just do a stack depth of two with one store.

<{POST_SNAPBACK}>

ayyy... Ok... I will give it a try.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#26 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 17 February 2006 - 04:20 PM

The basic way function are run is: firstnumber-enter-secondnumber-operation; there is no "equals" button.

The first number is place in the first place on the stack. The second number is also put in the first place on the stack and the first number moves to the second place on the stack. When the operation is performed on the two numbers, the stack is cleared and the result is place in the first place on the stack. If a third item is placed on the stack, everything shifts up and the top item is destroyed.

There is a place to store one number; this is outside the stack. The item in the first place on the stack is copied to this location; the stack item is not removed. A number retrieved from store is placed in the first stack position, everything moves up.

Swapping shifts the second stack item to the first and the first to the second.

So to review the button so far:
Store puts an item into storage.
Get, gets an item from storage
Swap, exchanges the two items on the stack.
The various arithmetic operators perform their function with stack item two being the first number and stack item one as the second item.

Above the buttons is a four-line display. The lowest line is the number presently being entered The second lowest line is stack item one, the second highest line is stack item two and the top is storage.

Now the more complicated part: entering numbers. There are nine numbers represented. Notice that 1,2, and 3 are grouped together, and that, 8, 16, and 24 are also grouped together. Each digit is "built". If you press 32 then the number will be at least 32, pressing four adds four to it. But repressing these numbers does nothing more. In the case of the grouped numbers if you press say 1 then it adds 1 to the number but if you now press 2 it will subtract 1 then add 2. So it will only take the last entery of the entire group. Zero is different, hitting zero sets the total to zero clearing whatever work you've done so far, so the digit is now set at zero. If you want though you can add to zero.

Hitting enter, enters the digit, then you star entering the next digit which then shift the digit you just entered one place to the left. Once you've entered the final digit you hit enter one more time to put the entire number in the first stack location. Hitting the x key is the decimal.

Clear as mud?
Posted Image
I'm starting to like the heavy cannon more and more.

#27 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 17 February 2006 - 05:20 PM

Hitting enter, enters the digit, then you star entering the next digit which then shift the digit you just entered one place to the left.  Once you've entered the final digit you hit enter one more time to put the entire number in the first stack location.  Hitting the x key is the decimal.

Clear as mud?

<{POST_SNAPBACK}>

Clear, but not programmable - at least I do not know how to until now... ^_^ . If I understand you correct, you want a double-enter for declaring the first number complete and stored in Level1 of the stack? I have absolutely no clue if, and if, how to program this in Java. Can't we just make an extra button? Hm. I will try to think of a way to code this, but maybe it would be better / more easy to add another button...

Edited by Mad, 17 February 2006 - 05:26 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#28 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 17 February 2006 - 10:19 PM

Enter for each digit of the number then enter for the entire number.

On the other hand anouther button wont hurt. Program for an extra button. I think I'll also add a clear stack and clear memory button too. Let me work on the graphic.
Posted Image
I'm starting to like the heavy cannon more and more.

#29 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 18 February 2006 - 06:25 AM

On the other hand anouther button wont hurt.  Program for an extra button.

<{POST_SNAPBACK}>

Ok, I'll work on it. :)

Edited by Mad, 18 February 2006 - 06:25 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#30 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 February 2006 - 11:55 AM

I've got the keypad in my head but I still have to draw it up. It'll be:

0,1,2,3,4
.,8,16,24,32
+,-,Put,Enter
*,/,Swap,Clear_Stack
^,Store,Get,Clear_Store
Posted Image
I'm starting to like the heavy cannon more and more.

#31 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 20 February 2006 - 12:35 PM

0,1,2,3,4
.,8,16,24,32
+,-,Put,Enter
*,/,Swap,Clear_Stack
^,Store,Get,Clear_Store

<{POST_SNAPBACK}>


Looking good :) (could you draw every button as single JPEG? So that it won't be one big picture, but 20 pictures? Thanks :) )
What is "swap" for?
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#32 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 February 2006 - 02:45 PM

To late.

Button up on the left
Button pressed on the right.

Attached Files


Posted Image
I'm starting to like the heavy cannon more and more.

#33 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 February 2006 - 03:10 PM

Lets make the display AT MOST 8 digits wide, and that's including decimal and exponent.

BTW what do think about exponent? Do you want to bother with that?
Posted Image
I'm starting to like the heavy cannon more and more.

#34 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 20 February 2006 - 05:13 PM

Lets make the display AT MOST 8 digits wide, and that's including decimal and exponent.

BTW what do think about exponent?  Do you want to bother with that?

<{POST_SNAPBACK}>

Exponent in the display? I'd rather not... ^_^ Decimal alone will be a pain in the a$$... :( Nice keypad :) Well, so I will try to cut it apart...
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#35 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 20 February 2006 - 07:33 PM

I figured you'd say that. I'd better come up with some error codes for the display then.

Come to think of it I should come up with the display. :(
Posted Image
I'm starting to like the heavy cannon more and more.

#36 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 21 February 2006 - 02:42 AM

I figured you'd say that.  I'd better come up with some error codes for the display then.

Come to think of it I should come up with the display. :(

<{POST_SNAPBACK}>

Error codes? Like: "What, you dare to think in such ambitious hights? The great OM will crush you for your arrogance!" ;)
Well, I figured we would just leave the display in a monochrome color (or non-color like white) which will be the color of the website in which javascript is printing the reults. And around it you could make a nice frame - so we would have a housing for the keypad and the display. Just like a good old earth calculator... :)
Well, and the thing with the exponents and decimals is a little bit complicated, since the program now calculates using integers. So technically ther are no decimals. I will have to write a complete new subroutine for that, and I'm "just" a CTD member after all... ;) so this might take me a while...

Edited by Mad, 21 February 2006 - 02:43 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#37 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 21 February 2006 - 11:28 AM

I was thinking of a segmented display. I meant error codess like: undefined (divide by zero or square root of a negative), over/underflow.

We can do reals of the 123.456 variety but skip the 123.456E100 variety.

Oh crap I've got to decide how I want to handle negatives!!!!
Posted Image
I'm starting to like the heavy cannon more and more.

#38 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 21 February 2006 - 12:07 PM

I was thinking of a segmented display.  I meant error codess like: undefined (divide by zero or square root of a negative), over/underflow.

We can do reals of the 123.456 variety but skip the 123.456E100 variety.

Oh crap I've got to decide how I want to handle negatives!!!!

<{POST_SNAPBACK}>

Yea, I would apreciate if we could skip the exponential thing. We can't use too big numbers anyway.

Segmented display? Yea, no problem. Just remember, that you won't see anything of the display anymore as soon as a number is displayed - that is of course if we stick with the digits the calculator now uses.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#39 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 21 February 2006 - 05:15 PM

Okay here' the potential outputs of the display. I'll post the blank display and chassiss shortly

Attached Files


Posted Image
I'm starting to like the heavy cannon more and more.

#40 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 21 February 2006 - 05:28 PM

Okay here' the potential outputs of the display.  I'll post the blank display and chassiss shortly

<{POST_SNAPBACK}>

Wow! This certainly looks cool! :)

---Edit---
On the other hand... I would like to do something veeery painful to you... You did it again: one big bmp instead of 74 small pictures... :Cry:
Well, at least it's easier to cut them out now with the white background... :)
In a related matter: what's the purpose of those "empty" fields?

Edited by Mad, 21 February 2006 - 05:39 PM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#41 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 21 February 2006 - 05:41 PM

Actually the "line" that says error you can take all 8 squares.

Anyway I've resized the buttons.

Here's the "pressed buttons.

Calculator


and it's ugly


Hey it's V.1

If someone wants to jazz it up, be my guest.

Attached Files


Posted Image
I'm starting to like the heavy cannon more and more.

#42 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 22 February 2006 - 02:43 AM

and it's ugly

<{POST_SNAPBACK}>

No, it's not! especially the display and the digits are pretty cool :) Ok, the dialpad might need some work, but then again, the code is far from done, so no need to hurry.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#43 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 22 February 2006 - 11:41 AM

Well perhaps the other folks who read this forum can try prettifying it.
Posted Image
I'm starting to like the heavy cannon more and more.

#44 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 22 February 2006 - 12:16 PM

Well perhaps the other folks who read this forum can try prettifying it.

<{POST_SNAPBACK}>

And if there is someone amongst these who knows javascript, thou shall raise their voices, 'cause I've run into some trouble using functions...
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#45 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 22 February 2006 - 12:38 PM

never used it but whats your question anyway.
Posted Image
I'm starting to like the heavy cannon more and more.

#46 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 22 February 2006 - 01:30 PM

never used it but whats your question anyway.

<{POST_SNAPBACK}>

Well, the thing is, I tried to write an input routine (which is "reading" the user input (user clicks on a digit, routine gets it and writes the digit to the screen)).
This is working fine, but two things bother me. 1st) It locks up in Firefox. After the digit is written to the screen it is caught in an endless loop and nothing happenes. And, possibly connected to the first error the 2nd) when I hit the reload button, nothing happenes. I have to open the script "fresh" so it will work again.

This is the test code I worked with so far:
<html>
<head>
<script language="javascript">
//initialize variable picname
var picname;

//declare function printpic, which can get one input variable (picname)
function printpic(picname)
{
//write "<IMG src = alienNumberXX.jpg>"  (where XX stands for a number from 0 to 64) to the html document, to call the picture with the correct digit.
document.write("<IMG src=alienNumber" +picname +".jpg>");
}   
</script>
</head>

<body>
//initialize a form for the keypad
<form name ="keypad">
//use a picture (of an alien digit) as input. when clicked initialize the function printpic with the corresponding number.
<input type="image"SRC=keypad1-1.jpg  name="key1" id="key1" onclick="printpic(1)" />
</form>
</body>
</html>
That's it. Ihave no clue why it's not working the way it should... :(
(I used the complete html structure, including every tag, so everyone can just copy&paste it in a text document and run it as html code. Pictures are not included, well, this shouldn't cause any trouble I think.)

Apreciate any help I can get. Thanks. :)
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#47 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 22 February 2006 - 01:36 PM

Is there error only occuring in firefox?
Posted Image
I'm starting to like the heavy cannon more and more.

#48 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 22 February 2006 - 01:38 PM

Is there error only occuring in firefox?

<{POST_SNAPBACK}>

The lockup error, yes. The reload error is occuring in IE too.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#49 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,527 posts

Posted 23 February 2006 - 01:36 PM

Have you try putting the text of the error (in quotes) into google and doing web and groups searches.
Posted Image
I'm starting to like the heavy cannon more and more.

#50 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 23 February 2006 - 03:32 PM

Have you try putting the text of the error (in quotes) into google and doing web and groups searches.

<{POST_SNAPBACK}>

There is no error message. It just won't work again when the reload button is hit.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image