Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-13-2004, 09:03 AM   #1
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default othello programing challenge

will accept entry until July 31th or even longer if ppl request it

and will compete on League format(i think that is what they call)
meaning one will compete with every other player.

read thread from general chat forum for general info.
http://www.actionscript.org/forums/s...3&goto=newpost

lets force the move under 1 minute.
if i missed some detail i should mention.
please inform me..

i work full time and have very little time to work on this..
but i will do my best to win.


Start the challenge!~!~!~!~!~
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-13-2004, 09:12 AM   #2
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

1 minute???
I would say 20 seconds on a P3 1ghz should be more than enough. You should not try to precalculate the whole game!

---------------------------------------------------------------------

the stage will load your swf and call a function named "ai".
it will also give a copy of an array containing the whole information you will need in your function. Your function will return an array with the x and the y coordinate of your turn.
example for your function

function ai(infoarray) {
return (/*any x between 0 and 7 i.e.:*/ 4, /*any y between 0 and 7 i.e.:*/ 5);
}

the infoarray will contain the current player (you)
and an array with the current field.
infoarray= [Current_Player, Current_Field_Array];
with Current_Field_Array containing 8 arrays with the x rows, containing 8 arrays with the y fields.

trace(infoarray[1][3][5]) //aka infoarray[1][x][y]
will return the owner of the field x=4, y=6 which is either
0 (empty)
1 (player1)
2 (player2)

so an example for an infoarray would be
Code:
infoarray=[1,[
[0,0,0,0,2,0,0,0],
[0,0,0,0,2,0,0,0],
[0,0,0,0,2,0,0,0],
[0,0,0,1,2,0,0,0],
[0,0,1,1,2,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0]
]]
so the fields
[2][4]
[3][3]
[3][4]
are yours (infoarray[1][2][4]==infoarray[0])
and
[4][0]
[4][1]
[4][2]
[4][3]
[4][4]
belong to your enermy

Your function has to return a legal turn (legal x and y coordinates)
legal turns in the upper example are
[5][1]
[5][2]
[5][3]
[5][4]
so your function could
return([5,1])


if you return an invalid turn, you will lose. if your function does not return a turn within the the time limits, your movie will be unloaded and you loose.

-------------------------------------------------------------------

You are not allowed to use
- other code from outside the swf (you may not load an other swf, nor you may pass the variables to an extern script that may calculate your thing,...)
- any _global tag
- any _level tags (i.e.: _level0)
- any setInterval tags
- any on or onClipEvent statements (i.e. onEnterFrame)
- any code outside functions or prototypes (i.e. code that will be called when the movie loads)
-anything that may influence the variables on the stage (_level0) and anything that will run after the return of your answer (i.e. setInterval wit huge for loops that will slow down the other player) that I forgot to name here

You are allowed to use
- _root tag (since the stage will apply flash7's _lockroot on the subswfs )
- as many functions and prototype functions as you want

so basically your swf has to contain a function with the name "ai" that will return a valid turn. the stage size of your Movieclip should be 50x50 and can contain some avatar.


I am still working on the stage, but I have only few time at the moment.
I have to learn, because there (maybe) is a school test on tuesday or wednesday. We have a print date that is much too early for our school newspaper, so I have to work for that too.
My mother is in hospital for pneumonia (she got it from my grandma who is in hospital too), and I visit my ma at least 1 time a day there. I actually got pneumonia too, and I am feeling a little sick now, but I can't allow myself to get really ill or go to hospital, because I won't be abled to finish my work then. (and there would be noone cooking for my little brother and my dad (who is an abolute incapable cook).

Last edited by McGiver; 06-13-2004 at 11:08 AM..
McGiver is offline   Reply With Quote
Old 06-13-2004, 09:19 AM   #3
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default

ok 30 second is enough
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-13-2004, 09:21 AM   #4
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default

i mean 20:
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-13-2004, 09:30 AM   #5
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

heheheeeee
20 is cool
okey, who is the first poster??
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 06-13-2004, 10:11 AM   #6
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default

i have invited marshdabeachy from bit-101
he already finished good othello program.
lets hope he comes.
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-13-2004, 11:09 AM   #7
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

hmm even 5 seconds should be enough (still a very long time)
but if people want we can say 20 seconds
McGiver is offline   Reply With Quote
Old 06-20-2004, 04:19 PM   #8
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

I didn't forget it, I was just bound to bed with my pneumonia.
As soon as I get up to date with my work, I will do this next
McGiver is offline   Reply With Quote
Old 06-20-2004, 04:48 PM   #9
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Hey, hope you get better, McGiver... We all want you to...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 06-21-2004, 02:08 AM   #10
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

Quote:
Originally Posted by CyanBlue
We all want you to...
lol
WE or YOU
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.