If you're trying to randomly generate an even or an odd number there's a simple way to do it. Basically just create a recursive function that will keep calling itself until it gets the proper number. This is a dirty way to do it however. Another way would be to use the original random number generator function. It basically generates a number between 0 to 1. With that you'd have to multiply it by the max number. Then you can round the number to the closes proper value. This is how I'd handle it.
Edit: to your second question.
Code:
i > h ( " i " must be > "h")
This would be a starting point. It could be a problem if i is ever = to 20 however.
I can't use swish. So I can't open your 'math code.swi' file. If you could point me to a Swish installer I could use then that would be different but it seems broken.
Also, Marital in english has to do with marriage. So using that word here is confusing. After looking at things it looks like you mean the word 'even'. If you're confused by a word I suggest you use the search in google like this: "define: marital".
I've created something that should do it:
Code:
function generateNum(range:Array, isEven:int=0):int {
//isEven should be == 0 for even numbers and == 1 for odd
var num:Number = range[0]+Math.random()*range[1];
return (int(num)%2==isEven?Math.floor(num):Math.ceil(num));
}
var even:int = generateNum([0,20],0);
var odd:int = generateNum([0,even],1);
The only problem with this is if even becomes 0. It will end up with both even and odd being 0.