It's been a while since I last dabbled in JS, and I was never really got the hang of scripting, but I'm trying to produce a javascript-based program designed to solve Bletchly Park problems. However, I'm sure the problem is due to my lack of understanding of how variables and things are declared.
Basically, I have a matrix (a 6x6 table) each of which has a letter or number inside it. The columns and rows are labelled 1-6 and a-b respectively. Each cell has a variable attached to it, for example cell number a1 has the variable a1. Simple, right? When I apply the variable to the innerHTML of a span, I get exactly what I'm looking for: the value of the cell (in this case x).
What I'm asking is, how do i make an input box, where you can enter a variable (eg a1) and return the value (x) to a span? I already have a function which does this, but it keeps returning it a a string, returning a1 instead of x... how do i change that?
I'm really enjoying working on this project, and would really like to get somewhere with it, so advice and help is gratefully recieved :D
Question
plasmarox
Hi all,
It's been a while since I last dabbled in JS, and I was never really got the hang of scripting, but I'm trying to produce a javascript-based program designed to solve Bletchly Park problems. However, I'm sure the problem is due to my lack of understanding of how variables and things are declared.
Basically, I have a matrix (a 6x6 table) each of which has a letter or number inside it. The columns and rows are labelled 1-6 and a-b respectively. Each cell has a variable attached to it, for example cell number a1 has the variable a1. Simple, right? When I apply the variable to the innerHTML of a span, I get exactly what I'm looking for: the value of the cell (in this case x).
What I'm asking is, how do i make an input box, where you can enter a variable (eg a1) and return the value (x) to a span? I already have a function which does this, but it keeps returning it a a string, returning a1 instead of x... how do i change that?
I'm really enjoying working on this project, and would really like to get somewhere with it, so advice and help is gratefully recieved :D
Link to comment
Share on other sites
4 answers to this question
Recommended Posts