Maths operations on a number in Max?

mimi2000's icon

Hello.

I'm thinking that this is easily achievable in Max, but I am having trouble getting my head around it....
I would like to be able to identify and list all possible consecutive 3 digit numbers from a longer number, and then to perform simple calculations (eg. add or subtract) between these 3 digit numbers.

eg 1234567 would give the following consecutive 3 digit numbers:

123, 234, 345, 456, 567,

Then I would like to be able to have Max perform simple maths operations using the various permutations of these 3 digit numbers eg:

123 + 234
123 + 345
123 + 456
123 + 567
234 + 345
234 + 456
234 + 567
345 + 456
345 + 567
456 + 567

Can anyone suggest how to go about this? Any help or pointers on how would be a great help.

mizu's icon

playing with atoi-itoa, way to begin ? :-) and some math of you

Max Patch
Copy patch and select New From Clipboard in Max.

zzz

mimi2000's icon

Many thx for your reply. I'm not sure I know exactly how to use your patch...
Time to re-read tutorials on lists etc. - any further pointers appreciated.
Thx again.

mizu's icon

sure can be simpler : from int 1234 to a list 1 2 3 4 ? my first idea was to travel thru atoi to recompose 123 234 with fromsymbol. Some magic boolean thing ?
zz perplex :-)) haha

Max Patch
Copy patch and select New From Clipboard in Max.