D dmorbelli New Member Licensed User Longtime User Sep 24, 2012 #1 Hey guys, I am trying to create a section of a game (basically good vs evil) where a person chooses a button which is either red or blue. I want the outcome of the button pressed to be determined by the date. example, if the red is pressed on an even day the result is good, but if it is an odd day, then the result will be evil. I would also like to add an extra result on a day which is a prime number the result will be an neutral person with extra powers. I hope that explains what I want to do, what I need help with is how to compare the dates, can I use a date format or is there a way to use julian dates in b4a. Thanks for any help in advance. Don
Hey guys, I am trying to create a section of a game (basically good vs evil) where a person chooses a button which is either red or blue. I want the outcome of the button pressed to be determined by the date. example, if the red is pressed on an even day the result is good, but if it is an odd day, then the result will be evil. I would also like to add an extra result on a day which is a prime number the result will be an neutral person with extra powers. I hope that explains what I want to do, what I need help with is how to compare the dates, can I use a date format or is there a way to use julian dates in b4a. Thanks for any help in advance. Don
NJDude Expert Licensed User Longtime User Sep 24, 2012 #2 If you want to know the day, then you can do something like this: Code: Msgbox(DateTime.GetDayOfMonth(DateTime.Now), "") The line above will show the day of the current date. Upvote 0
If you want to know the day, then you can do something like this: Code: Msgbox(DateTime.GetDayOfMonth(DateTime.Now), "") The line above will show the day of the current date.
D dmorbelli New Member Licensed User Longtime User Sep 24, 2012 #3 NJDude said: If you want to know the day, then you can do something like this: Code: Msgbox(DateTime.GetDayOfMonth(DateTime.Now), "") The line above will show the day of the current date. Click to expand... Thanks for the reply, I might not have made this clear, but I am not trying to display the date, I merely want to use the date as a way to choose an outcome. for example if a person chooses red and the date is dec 31 then the julian date is 365 which would make it an odd number making the result evil, but if the person chooses red and the date is dec 30 then the julian date is 364 then the number is even and the result is good. Upvote 0
NJDude said: If you want to know the day, then you can do something like this: Code: Msgbox(DateTime.GetDayOfMonth(DateTime.Now), "") The line above will show the day of the current date. Click to expand... Thanks for the reply, I might not have made this clear, but I am not trying to display the date, I merely want to use the date as a way to choose an outcome. for example if a person chooses red and the date is dec 31 then the julian date is 365 which would make it an odd number making the result evil, but if the person chooses red and the date is dec 30 then the julian date is 364 then the number is even and the result is good.
NJDude Expert Licensed User Longtime User Sep 24, 2012 #4 Ok, then do this: Code: Msgbox(DateTime.GetDayOfYear(DateTime.Now), "") For more info, read the documentation about DateTime Upvote 0
Ok, then do this: Code: Msgbox(DateTime.GetDayOfYear(DateTime.Now), "") For more info, read the documentation about DateTime
D dmorbelli New Member Licensed User Longtime User Sep 24, 2012 #5 NJDude said: Ok, then do this: Code: Msgbox(DateTime.GetDayOfYear(DateTime.Now), "") For more info, read the documentation about DateTime Click to expand... Thank you sir. I do appreciate your help. Upvote 0
NJDude said: Ok, then do this: Code: Msgbox(DateTime.GetDayOfYear(DateTime.Now), "") For more info, read the documentation about DateTime Click to expand... Thank you sir. I do appreciate your help.