When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
61 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
here is the paste bin of my code
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what i am doing is always receiving data parse -> attribute -> use current state -> get current state -> get command again
i wanted to parse it and then attribute based on the state i am in
but i am left with a problem because i only get the next state after
so i am always doing it with my current state not updating it
for example CS 0
doing it with reset
after i input CS 1 i am doing it with state_reset too
because only after that cycle happens is the state updated
and certains commands can only be used in certain states or attributed
ayo portuguese!
im portuguese too!
are we allowed to speak portuguese here?
give me a bit, ill try to help you
boas
imagina eu preciso desta tabela de estados
.
e tenho ai o codigo que ja fiz
so que depenendo do estado em que estou eu so posso receber comandos especificos
se o utilizador mete commandos que n sao os corretos para o estado devia dar erro
certo
eu nao percebi muito bem qual era o problema
dei uma vista de olhos no codigo ya
mas nao vi aprofundadamente
sou um bocado iniciante em c mas posso ver se consigo ajudar e dar alguma ideia
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what i did was this
e tas com problema no que?
opah agora ta resolvido
mas esta com ifs
e else ifs
e esta um bcd com ifs com comparacao de estados
esta um bcd a "pedreiro" se assim lhe podemos chanar
em uma parte
nao dava para fazer com switch case ai?
foi a soluçao que arranjei
acho que não é uma má solucao
n pk sao strcmps
sao cada comando
n posso fazer um switch case com o current state pk so preciso de verificar para cada commando o estado emque estou
pk primeiro faco um for para verificar o comando
se encontra o commando ve o estado em que esta
se for o estado correto atribui
se n n atribui
ou seja n altero nada
vê aí a terceira resposta disso
parece interessante
seria mais organizado digo eu
mas ya, sempre que recebe um comando tens de verificar em que estados estas
acho que nao ha volta a dar a isso