Sign in to follow this  
Followers 0
GodForsakenSoul

writing a score

9 posts in this topic

i'm in the ending stages of my first ever program! yay me.

i'm having a small problem with the score window.

while i CAN use a label for it, i don't want to. i want to use pictures of numbers instead.

my current idea is incredibly retarded because i basically think of mapping out every possibly 1-9 outcome.

that will be time consuming, and i will end up with an ungodly huge function.

is there an easier way that i don't know of?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Take images: 1.png 2.png 3.png 4.png etc.etc. 8.png 9.png

Write algorithm: SetImage($c, $i) = set image to control $c to image $i.png

Then another algorithm: SetNumber($i) = SetImage($leftcontrol, Round($i/10)) , SetImage($rightcontrol, Mod($i, 10))

Edited by Manadar

Share this post


Link to post
Share on other sites

could you explain it more thoroughly please?

i can't quite understand what you mean

Share this post


Link to post
Share on other sites

If you're uncomfortable with talking in abstracts, make your question concrete. Show what you're trying to do in some pseudo code, and I'll improve it in some pseudo code.

Share this post


Link to post
Share on other sites

$score=iniread("OPT.INI","ANSWERS","SCORE","0")

StringDivide($score) ;put spaces between each number

And from there somehow get the position of each individual number and set a large function to assign the pictures depending on the number and its position.

is it even possible?

Share this post


Link to post
Share on other sites

I would try using StringSplit, StringSplit ($score, ""), then (with 0.png thru 9.png already created) pick the correct file with array[n], (array[n] & ".png"), with an array[0] loop.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

the problem with StringSplit() is that i have to have a "denlimiter".

snce i'm string splitting a variable, i don't have a way to shove it in between numbers.

otherwise it would be awesome.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

your delimetar is "" so it will split it on nothing, did you try it before you posted this?

Remarks

If you use a blank string "" for the delimiters, each character will be returned as an element.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

your delimetar is "" so it will split it on nothing, did you try it before you posted this?

oh.... i honestly didn't think of this -headdesk- ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0