I want shorten the if condition. How can I simplify this? Where step = 1 to 240 in min
I want 1st 3 min ON= 1, second 10 min OFF = 0, It will repeated until 248 min I wrote "if condition" which is consist of many condition. How to rewrite the code with simple expression
#include "udf.h"
DEFINE_PROFILE(ON_3min_OFF_10min_4Hr,thread,position)
{
face_t f;
real step,hf_3min,hf_10min;
hf_3min = 1; /*ON */
hf_10min = 0; /*OFF */
step=N_TIME;
begin_f_loop(f,thread)
{
if ((step<=3) || ((step>13) && (step<=16)) || ((step>26) && (step<=29)) || ((step>39) && (step<=42)) || ((step>52) && (step<=55)) || ((step>65) && (step<=68)) || ((step>78) && (step<=81)) || ((step>91) && (step<=94)) || ((step>104) && (step<=107)) || ((step>117) && (step<=120)) || ((step>130) && (step<=133)) || ((step>143) && (step<=146)) || ((step>156) && (step<=159)) || ((step>169) && (step<=172)) || ((step>182) && (step<=185)) || ((step>195) && (step<=198)) || ((step>208) && (step<=211)) || ((step>222) && (step<=225)) || ((step>235) && (step<=238)))
{
F_PROFILE(f,thread,position)=hf_3min;
}
else
{
F_PROFILE(f,thread,position)=hf_10min;
}
}
end_f_loop(f,thread)
}