THE DCS COMPUTER SCIENCE CLUB FORUM

This forum is designed for the Computer Science Students of Concepcion Holy Cross College with the idea of helping fellow student users with its problems, questions and optimize its usage to the fullest. enjoy sharing your knowledge and helping others.
 
HomePortalCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share
 

 i need help... anyoune??

Go down 
Go to page : 1, 2, 3, 4  Next
AuthorMessage
bambsx
megabyte
bambsx

Posts : 222
Join date : 2009-07-03
Age : 28
Location : Planet Crypton

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri 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!

_________________
i need help... anyoune?? 21863124v2147483647_350x350_Front
Back to top Go down
View user profile http://www.friendster.com/demonyitoh
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri 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
Back to top Go down
View user profile
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri 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. lol!

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 Laughing

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri 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
Back to top Go down
View user profile
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptySat 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
Back to top Go down
View user profile
bambsx
megabyte
bambsx

Posts : 222
Join date : 2009-07-03
Age : 28
Location : Planet Crypton

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyMon 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??)

_________________
i need help... anyoune?? 21863124v2147483647_350x350_Front
Back to top Go down
View user profile http://www.friendster.com/demonyitoh
pxkos
megabyte
pxkos

Posts : 149
Join date : 2009-07-05
Location : Philippines

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyMon 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
i need help... anyoune?? Untitl12
Back to top Go down
View user profile
pxkos
megabyte
pxkos

Posts : 149
Join date : 2009-07-05
Location : Philippines

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyMon Jul 20, 2009 12:15 pm

DeeCee wrote:
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. lol!

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 Laughing

algo or pseudocode sr. pwede?

_________________
-pxkos
i need help... anyoune?? Untitl12
Back to top Go down
View user profile
pxkos
megabyte
pxkos

Posts : 149
Join date : 2009-07-05
Location : Philippines

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyMon 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 need help... anyoune?? Untitl11

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] What a Face
STEP5. do step 2 and step 3 for the 2nd input and repeat until 9th input.
STEP6. END

_________________
-pxkos
i need help... anyoune?? Untitl12
Back to top Go down
View user profile
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyTue Jul 21, 2009 8:48 am

pxkos wrote:
DeeCee wrote:
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. lol!

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 Laughing

algo or pseudocode sr. pwede?

pwede sir... actually nagbrabraibstorm kami tapos discuss namin yung algo nya and yung possible issues na ma encounter nila along the way.

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
mhae
byte
mhae

Posts : 41
Join date : 2009-07-07
Age : 25
Location : sta.cruz concepcion tarlac

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyWed Jul 22, 2009 4:16 pm

hellow pho!!!

ang hirap namn pho kasi ng pinapagawa ni sir.,.,

Crying or Very sad
Back to top Go down
View user profile http://mae_net@yahoo.com
Baldo
megabyte
Baldo

Posts : 137
Join date : 2009-07-06
Location : HUWAAT!!!

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyWed Jul 22, 2009 4:24 pm

mag aral mabuti!!

_________________
-pls. read Signature Tips and Guidelines under General Rules and Regulation section

by: -px
Back to top Go down
View user profile http://csctrojans.uuuq.com
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyWed Jul 22, 2009 5:04 pm

mhae wrote:
hellow pho!!!

ang hirap namn pho kasi ng pinapagawa ni sir.,.,

Crying or Very sad

sa umpisa lang mahirap yan...

sa susunod.....

mas mahirap pa dyan... bwahaha tongue

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyThu 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
Back to top Go down
View user profile
pxkos
megabyte
pxkos

Posts : 149
Join date : 2009-07-05
Location : Philippines

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyThu 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 lol!

_________________
-pxkos
i need help... anyoune?? Untitl12
Back to top Go down
View user profile
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyThu Jul 23, 2009 4:48 pm

bwahaha...

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
bambsx
megabyte
bambsx

Posts : 222
Join date : 2009-07-03
Age : 28
Location : Planet Crypton

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri Jul 24, 2009 10:49 am

hahahaha Razz

_________________
i need help... anyoune?? 21863124v2147483647_350x350_Front
Back to top Go down
View user profile http://www.friendster.com/demonyitoh
mpascual

mpascual

Posts : 15
Join date : 2009-07-22
Age : 28
Location : Lilibangan cpn trlc

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri Jul 24, 2009 2:08 pm

Sir mahirap po talaga!!!!!!!hehehe Basketball [code][quote]
Back to top Go down
View user profile
gudboygo2hell_remake
megabyte
gudboygo2hell_remake

Posts : 201
Join date : 2009-07-20
Location : SETTE DESERT (56,96)

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri Jul 24, 2009 2:09 pm

lolz....patayan na pala ito ehhh....

ahahahahaha

dugo utak nyo nyan.....

buti nalng tapos na ako dyan Shocked

_________________
-gudboygo2hell.remake@gmail.com


"Huwag mamapak ng asin pag gutom"
- Bertong Badtrip
Back to top Go down
View user profile
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri Jul 24, 2009 2:35 pm

huh? tapos ka na? talaga? tingnan natin Exclamation

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
bambsx
megabyte
bambsx

Posts : 222
Join date : 2009-07-03
Age : 28
Location : Planet Crypton

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri Jul 24, 2009 3:03 pm

miti ka kin sakin!!!! ban na ulit yan!!!

_________________
i need help... anyoune?? 21863124v2147483647_350x350_Front
Back to top Go down
View user profile http://www.friendster.com/demonyitoh
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptyFri 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
Back to top Go down
View user profile
pxkos
megabyte
pxkos

Posts : 149
Join date : 2009-07-05
Location : Philippines

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptySat Jul 25, 2009 8:52 pm

uu nga noh. go crisanta kaya mo yan... cheers

_________________
-pxkos
i need help... anyoune?? Untitl12
Back to top Go down
View user profile
DeeCee
Admin
DeeCee

Posts : 100
Join date : 2009-07-10
Location : Sa Tabi Tabi

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptySun Jul 26, 2009 4:16 pm

hehehe... go CRISANTA!

_________________
i need help... anyoune?? Signaturenf
Back to top Go down
View user profile
mushter
megabyte
mushter

Posts : 200
Join date : 2009-07-03
Age : 30
Location : Sta. Cruz

i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? EmptySun Jul 26, 2009 8:17 pm

sabi ni noel bang-asan tapos na xa, pati xa hingi kayo ng payo sa kanya, nyahaha
Back to top Go down
View user profile
Sponsored content




i need help... anyoune?? Empty
PostSubject: Re: i need help... anyoune??   i need help... anyoune?? Empty

Back to top Go down
 
i need help... anyoune??
Back to top 
Page 1 of 4Go to page : 1, 2, 3, 4  Next

Permissions in this forum:You cannot reply to topics in this forum
THE DCS COMPUTER SCIENCE CLUB FORUM :: GENERAL DISCUSSIONS :: ARCHIVES-
Jump to: