Java: Given 2 integer variables and 2 hashmap variables how to create their all possible combinations [on hold]

304
January 13, 2017, at 12:39 PM

Given the following variables and domains:

int a==> domain={0, 1, 2, 3}

HashMap h1==> key domain={2, 3} and value domain={0, 1, 2}

HashMap h2==> key domain={1, 4} and value domain={0, 1, 2}

int c==> domain={0, 1}

How can I take all possible combinations of these variables. Following is a sample of outputs:

a, h1, h2, c

0, {2=0,3=0}, {1=0,4=0}, 0

0, {2=0,3=0}, {1=0,4=0}, 1

0, {2=0,3=0}, {1=0,4=1}, 0

0, {2=0,3=0}, {1=0,4=1}, 1

0, {2=0,3=0}, {1=0,4=2}, 0

0, {2=0,3=0}, {1=0,4=2}, 1

0, {2=0,3=0}, {1=1,4=0}, 0

0, {2=0,3=0}, {1=1,4=0}, 1 ... etc.

READ ALSO
Pixel collision detection in libgdx

Pixel collision detection in libgdx

I am creating a maze game in libGDXThe background texture is very similar to this one: http://www

490
Appending a string at the start of StringBuilder. Insert not working

Appending a string at the start of StringBuilder. Insert not working

I have some code that generates a random password based on user choicesHowever, I am having issues regarding including a custom work at the start and at the end of the randomly generated word

434
Relative vs Absolute Paths Java

Relative vs Absolute Paths Java

I have a programming mini competition tomorrow and we will be required to create our program on a flash drive givenThe judges won't edit our code so it runs and I am worried that the flash drive letter will change and then my program won't be able to locate...

385
explode string,number, and symbol to an array php

explode string,number, and symbol to an array php

Please help me to explode the row item name and quantity according to store code with PHP and MySQL table, as shown below

291