Skip to content
Sergey Bronnikov edited this page Jan 26, 2018 · 7 revisions

Let's imagine we have a program with three features and various values for each feature:

  • Sex: ♀️, ♂️
  • Sport: 🏇, 🚴, 🚣, 🏊, ⛹️, ⛷
  • Mood: 😃, 😉, 😋, 😎, 🤐, 🤒, 😠, 😦, 😧, 😨, 😴, 😌

Jenny can generate combinations:

$ ./jenny -n3 2 6 12
 1a 2d 3j 
 1b 2e 3i 
 1a 2a 3e 
 ...
 
 1a 2f 3i 
 1b 2a 3c 

where 3 is a number of features in combination, 2, 6 and 12 are numbers of possible values for the appropriate feature. Total number of possible combinations is 144.

$ cat jenny.sed
# number the testcases
=


# Dimension 1
s/ 1a / ♀️ /g
s/ 1b / ♂️ /g

# Dimension 2
s/ 2a / horse_racing /g
s/ 2b / biking_man /g
s/ 2c / rowing_man /g
s/ 2d / swimming_man /g
s/ 2e / basketball_man /g
s/ 2f / skier /g

# Dimension 3
s/ 3a / smiley /g
s/ 3b / wink /g
s/ 3c / yum /g
$ sed -f jenny.sed output.txt
Clone this wiki locally