Simple Mathematics Question.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Simple Mathematics Question.
Hi Guys!!
I have google searched and I am unable to find a solution to a simple maths question.
I am making an app (Android) that records how many arrow shots that are fired by a person at an archery shooting range. The question is, how (mathematically), could I determine how many arrows (on average) are shot by the person per minute? Any help would be gratefully received!
Many Thanks,
Googie.
I have google searched and I am unable to find a solution to a simple maths question.
I am making an app (Android) that records how many arrow shots that are fired by a person at an archery shooting range. The question is, how (mathematically), could I determine how many arrows (on average) are shot by the person per minute? Any help would be gratefully received!
Many Thanks,
Googie.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Simple Mathematics Question.
That should be very simple indeed, and the Maths is,
but the implementation is where things can get
awkward if you are relatively new to LiveCode.
but the implementation is where things can get
awkward if you are relatively new to LiveCode.
Re: Simple Mathematics Question.
tTIME is the total time in minutes that archer is shooting.
tArrows is the total number of arrows fired by archer.
tAVERAGE is the answer of average arrows per minute for archer
tAVERAGE = tARROWS divided by tTIME
tArrows is the total number of arrows fired by archer.
tAVERAGE is the answer of average arrows per minute for archer
tAVERAGE = tARROWS divided by tTIME
Re: Simple Mathematics Question.
Here is my app that I am working on. Any ideas on how I could make the Arrows per minute, based on the total arrows fired?
Many Thanks,
Google.
Many Thanks,
Google.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Simple Mathematics Question.
pseudoCode
put theNumberOfArrows/minutesElapsed into averageShotsPerMin
put theNumberOfArrows/minutesElapsed into averageShotsPerMin
Re: Simple Mathematics Question.
Hi Guys!!
I have the following code that needs to run in the background of my app:
I cant run any code after this part of my app is called.
Many Thanks,
Googie.
I have the following code that needs to run in the background of my app:
global timeminutes,timecount,StopVar
on shootcount
if StopVar = "1" then
break
end if
if timecount = "60" then
put "0" into timecount
add "1" to timeminutes
put timeminutes&" Minutes." into temp
put temp into field "TimeElapsedTotal"
shootcount
else
wait 1 second
add "1" to timecount
shootcount
end if
end shootcount
I cant run any code after this part of my app is called.
Many Thanks,
Googie.
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Simple Mathematics Question.
Hi.
A hoot.
On a new card make a button and two fields. In the button script:
This is wordy, but that is just because I threw it together. Click the button to start the timing. Press the controlKey for each shot. Field 1 will count the number of arrows. When you press the CommandKey, the results of the session will be calculated, in shots per minute.
This needs to be adapted to your output gadget, but I hope you see what I was doing.
Craig Newman
A hoot.
On a new card make a button and two fields. In the button script:
Code: Select all
local tSeconds, tStartTime, totArrows
on mouseUp
put the seconds into tStartTime
put the seconds into tSeconds
put 0 into totArrows
put 0 into fld 1
put "" into fld 2
shootCount
end mouseUp
on shootCount tSeconds
put the seconds into tSeconds
if the optionKey is down then exit to top --escape
if the commandKey is down then put totArrows / (tSeconds - tStartTime) * 60 into fld 2
if the controlKey is down then
add 1 to totArrows
put totArrows into fld 1
wait 30
end if
send "shootCount" && tSeconds to me in 1
end shootCount
This needs to be adapted to your output gadget, but I hope you see what I was doing.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Simple Mathematics Question.
Just a postScript...
Heh, heh.
You mentioned that this had to run "in the backGround".
You understand that once this handler is set in motion, it will work while any other app is in front. In the background.
This may mean that my use of those three "control" keys is not quite what you might want. You will have to decide what those other apps might require to determine whether the control keys are breaking the intent of the handler. Are you OK with using some other means if so?
All right, already, Lagi.
Craig
Heh, heh.
You mentioned that this had to run "in the backGround".
You understand that once this handler is set in motion, it will work while any other app is in front. In the background.
This may mean that my use of those three "control" keys is not quite what you might want. You will have to decide what those other apps might require to determine whether the control keys are breaking the intent of the handler. Are you OK with using some other means if so?
All right, already, Lagi.
Craig