Question about using a date as a decision maker

dmorbelli

New Member
Licensed User
Longtime User
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
 

dmorbelli

New Member
Licensed User
Longtime User
If you want to know the day, then you can do something like this:
B4X:
Msgbox(DateTime.GetDayOfMonth(DateTime.Now), "")

The line above will show the day of the current date.
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
Top