| i need help... anyoune?? | |
|
+11myrrh fizhbone -=KC=- gudboygo2hell_remake mpascual Baldo mhae pxkos DeeCee mushter bambsx 15 posters |
|
Author | Message |
---|
bambsx megabyte
Posts : 222 Join date : 2009-07-03 Age : 34 Location : Planet Crypton
| Subject: Re: i need help... anyoune?? Fri Jul 17, 2009 4:31 pm | |
| technique lang kelangan jan..download ng file. tpos i edit,make sure alam mo ang gnawa or inedit mo.. o kya make sure na alam mo ang gagawin mo.THINK! | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Fri Jul 17, 2009 8:25 pm | |
| Marami kasi dapat isipin sa tictactoe 1st panu ba ako mag-iinput coordinates plus Enter ba? or using numpad? Sinabi na rin kasi sa king na goto, gotoxy, and if and else ang gagamitin. Ginagamit kasi sa tictactoe ayon sa mga nakita at nagawa namin is arrays, loopings, switch case, if and else and function. Kung ang gagamitin nyo goto gotoxy at if and else lang pwede pero mahaba ang code and prone sa errors.
Ngayon kung numpad gamit nyo ganito idea ko pero mas marami pa na mas ok na sagot 3 by 3 board game ang tictactoe so isipin na mga numbers sa numpad e nagrerepresents sa 9 square ng board game -------- |7|8|9| -------- |4|5|6| -------- |1|2|3| --------
pag nagpress ako ng numbers dapat may maprint na X for player1 and O for player 2 using variblename = getch(); --------- |X|O|X| --------- |X|O|O| --------- |X|X|O| ---------
ngayon panu ba magchecheck if player1 or player2 win o kaya draw? dahil nga di pwede ang array gawa kayo ng 9 variables na magrerepresents sa mga numbers ng numpad example char num1 num2 num 3 .... num9;
kada press ko ng number naguupdate rin ung mga variables at the same time na priprint ang X or O, If di 1 to 9 at saka pag ang variable na nagrerepresents sa number na press mo ay meron ng X or O o kahit anung value maliban sa space ' ' walang mangyayari or mapiprint kundi babalik ulit ako sa pagprepress example
player1again: variablename = getch(); if(variablename == '1'){ if(num1 != ' ') goto player1again; } else{ gotoxy(1, 3); print("X"); num1 = 'X'; } } } else{ goto player1again; }
ngayon pag chineck mo na
if(num1 == 'X' && num2 == 'X' && num3 == 'X'){ printf("Player1 wins"); goto exit; }
pareho lang para sa player2 na may 'O'
para sa draw naman kapag napuno na ang board e di draw na example
if(n1 != ' ' && n2 != ' ' && n3 != ' ' && n4 != ' ' && n5 != ' ' && n6 != ' ' && n7 != ' ' && n8 != ' ' && n9 != ' '){ printf("DRAW"); goto exit; }
ilagay nyo yan sa player1 kasi player1 ang huling magprepress ng keystroke
hope nakatulong ako gud luck | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| Subject: Re: i need help... anyoune?? Fri Jul 17, 2009 10:50 pm | |
| hehehe... d nila pwede gamitin getch(); para sa pagkuha nila ng input. hanggang scanf() muna sila. ok lang muna kung may errors.. ang importante maisip nila kung papano gawin yung sequence tapos paano nila iaddress yung mga issues na maeencounter nila. anyway... sa mga gustong tumulong... pls., wag nyo bigyan ng code, just help them think kung paano lang nila pwede attack yung problem. guide lang nyo sila kung papano dapat yung flow or kung maari... sa kanila manggaling yung idea tapos tapos tanungin lng natin sila sa mga issues or problems na pwede nila maencounter dun sa idea nila. in that way we could help them think and hopefully help them to become better programmers. hehehe syempre bago sarap.. hirap muna | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Fri Jul 17, 2009 10:55 pm | |
| Hehe kasakit ita scanf daw gagamitin pareho lang yan search nyo na lang if panu di ko naman binigay lahat sir bahala na sila hehe | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Sat Jul 18, 2009 7:02 pm | |
| Mga 1st year isipin nyo na lang muna kung panu gawin yung program at pag may naencounter kayo ng error post na lang kayo ulit!!! Dapat nga naman mag-isip muna tayo para sa atin rin yan. Sorry to say wala kayong madadadownload na code ng tic tac toe na ganyan ang gagamiting code bwahahaha | |
|
| |
bambsx megabyte
Posts : 222 Join date : 2009-07-03 Age : 34 Location : Planet Crypton
| Subject: Re: i need help... anyoune?? Mon Jul 20, 2009 10:59 am | |
| download nga sila ng code ng TTT sa net,.tpos palitin nlang mga code kunwari my function,alisin nila tpos diskartihan ang mga codes na inimput nila. thats ol i can share. sbi nga ni sir sok, a good programmer COPY, a great programmer STEAL (tama ba??) | |
|
| |
pxkos megabyte
Posts : 149 Join date : 2009-07-05 Location : Philippines
| Subject: Re: i need help... anyoune?? Mon Jul 20, 2009 12:11 pm | |
| using scanf is not a big problem. But I see a lots of line codes here and will come up to spaghetti code. tsk tsk tsk...
can anyone give me the exact problem (requirements)so that i can help. | |
|
| |
pxkos megabyte
Posts : 149 Join date : 2009-07-05 Location : Philippines
| |
| |
pxkos megabyte
Posts : 149 Join date : 2009-07-05 Location : Philippines
| Subject: Re: i need help... anyoune?? Mon Jul 20, 2009 5:02 pm | |
| i hope this algo can help upon analyzing the problem although wala naman nag post... I come up with simple solution: STEP1. I need to declare 9 variables because ttt has 9 boxes and its box need an input. STEP2. (first input)ask the user to input value (X or O) (using scanf) STEP3. check if there is a match why checking for the first inputted value? well that's the way it is. I need to check my boxes if there is a match every time user input value to do this I need to consider the ff: a. I have 8 match to identify if there is a winner 3 vertical matches, 3 horizontal matches and, 2 slanting matches. b. on each match I have 3 variable to compare example var1,var5,var9. I need to check if this 3 variable has the same value (for example X) c. I have 2 inputted value which is X and O. I have 8 matches, 3 variable to compare its match and 2 inputted value. so I come with this solution: for the X input value: I have 8 if statements with 3 variable to compare on its condition using AND operator "&&" for the O input value: I have 8 if statements with 3 variable to compare on its condition using AND operator "&&" therefore on each checking I need 16 nested if for X and O. EXAMPLE CONDITION: var1 is equal to X and var5 is equal to X and var9 is equal to X (match) var1 is equal to X and var5 is equal to X and var9 is equal to O (not match) STEP4. if match goto message then end program, if not match do nothing [/i] STEP5. do step 2 and step 3 for the 2nd input and repeat until 9th input. STEP6. END | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| |
| |
mhae byte
Posts : 41 Join date : 2009-07-07 Age : 31 Location : sta.cruz concepcion tarlac
| Subject: Re: i need help... anyoune?? Wed Jul 22, 2009 4:16 pm | |
| hellow pho!!! ang hirap namn pho kasi ng pinapagawa ni sir.,., | |
|
| |
Baldo megabyte
Posts : 137 Join date : 2009-07-06 Location : HUWAAT!!!
| Subject: Re: i need help... anyoune?? Wed Jul 22, 2009 4:24 pm | |
| | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| Subject: Re: i need help... anyoune?? Wed Jul 22, 2009 5:04 pm | |
| - mhae wrote:
- hellow pho!!!
ang hirap namn pho kasi ng pinapagawa ni sir.,.,
sa umpisa lang mahirap yan... sa susunod..... mas mahirap pa dyan... bwahaha | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Thu Jul 23, 2009 11:32 am | |
| Talagang ganyan matututo din naman kayo, madali pa nga yan di pa yan ang mahirap na kay sir pxkos pa, hehe tutulungan naman kayo ng mga higher year, pero xempre mag-aral muna pag di na kaya edi patulong gud luck | |
|
| |
pxkos megabyte
Posts : 149 Join date : 2009-07-05 Location : Philippines
| Subject: Re: i need help... anyoune?? Thu Jul 23, 2009 4:20 pm | |
| dont wori 1st year pag ako instructor nyo nxt sem DATA STRUCTURE tictactoe parin para di na kayo mahirapan. di nyo ba alam na ako pinakamabait na instructor... nyahahahaha | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| Subject: Re: i need help... anyoune?? Thu Jul 23, 2009 4:48 pm | |
| | |
|
| |
bambsx megabyte
Posts : 222 Join date : 2009-07-03 Age : 34 Location : Planet Crypton
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 10:49 am | |
| hahahaha | |
|
| |
mpascual
Posts : 15 Join date : 2009-07-22 Age : 34 Location : Lilibangan cpn trlc
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 2:08 pm | |
| Sir mahirap po talaga!!!!!!!hehehe [code][quote] | |
|
| |
gudboygo2hell_remake megabyte
Posts : 201 Join date : 2009-07-20 Location : SETTE DESERT (56,96)
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 2:09 pm | |
| lolz....patayan na pala ito ehhh.... ahahahahaha dugo utak nyo nyan..... buti nalng tapos na ako dyan | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 2:35 pm | |
| huh? tapos ka na? talaga? tingnan natin | |
|
| |
bambsx megabyte
Posts : 222 Join date : 2009-07-03 Age : 34 Location : Planet Crypton
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 3:03 pm | |
| miti ka kin sakin!!!! ban na ulit yan!!! | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Fri Jul 24, 2009 10:33 pm | |
| si crisanta baka alam na niya yan, di ba dumaan na xa sa paghihirap ni sir sok? kya yan | |
|
| |
pxkos megabyte
Posts : 149 Join date : 2009-07-05 Location : Philippines
| Subject: Re: i need help... anyoune?? Sat Jul 25, 2009 8:52 pm | |
| uu nga noh. go crisanta kaya mo yan... | |
|
| |
DeeCee Admin
Posts : 100 Join date : 2009-07-10 Location : Sa Tabi Tabi
| Subject: Re: i need help... anyoune?? Sun Jul 26, 2009 4:16 pm | |
| | |
|
| |
mushter megabyte
Posts : 200 Join date : 2009-07-03 Age : 35 Location : Sta. Cruz
| Subject: Re: i need help... anyoune?? Sun Jul 26, 2009 8:17 pm | |
| sabi ni noel bang-asan tapos na xa, pati xa hingi kayo ng payo sa kanya, nyahaha | |
|
| |
Sponsored content
| Subject: Re: i need help... anyoune?? | |
| |
|
| |
| i need help... anyoune?? | |
|