<commit_before># # simple bracelet:(min 2 colors, min 4 threads, any nr of threads)
# # knots:
# puts "X__"
# puts "OX_"
# puts "XOX"
# puts "OXO"
# puts "_OX"
# puts "__O"

# # chevron bracelet: (min 2 colors, min 4 threads, even nr of threads, half mirroring the other half)
# # knots:
# puts "X_X"
# puts "OXO"
# puts "XOX"
# puts "_X_"

# # triangle bracelet:(min 2 colors, min 4 threads)
# # knots:
# puts "X__"
# puts "XX_"
# puts "XXO"
# puts "XOX"
# puts "OXX"
# puts "XOX"
# puts "_XO"
# puts "__X"

#width = number of knots in a line
def simple_bracelet(length, width, nr_of_colors)
	if nr_of_colors > width
		puts "Number of colors needs to be equal or less than width"
		return
	end

	colors = ['X', 'O', 'A', 'Z', 'W', 'S', 'H'].sample(nr_of_colors)
	knots = colors

	until knots.length == width
		knots << colors.sample
	end

	length.times do |i| # 1 sequence
		puts knots.join(',')
	end
end

simple_bracelet(1, 3, 2)<commit_msg>simple bracelet works for any number of knots<commit_after># # simple bracelet:(min 2 colors, min 4 threads, any nr of threads)
# # knots:
# puts "X__"
# puts "OX_"
# puts "XOX"
# puts "OXO"
# puts "_OX"
# puts "__O"

# # chevron bracelet: (min 2 colors, min 4 threads, even nr of threads, half mirroring the other half)
# # knots:
# puts "X_X"
# puts "OXO"
# puts "XOX"
# puts "_X_"

# # triangle bracelet:(min 2 colors, min 4 threads)
# # knots:
# puts "X__"
# puts "XX_"
# puts "XXO"
# puts "XOX"
# puts "OXX"
# puts "XOX"
# puts "_XO"
# puts "__X"

#width = number of knots in a line. 
def simple_bracelet(length, width, nr_of_colors)
	nr_of_threads = width + 1
	if nr_of_colors > nr_of_threads
		puts "Number of colors needs to be equal or less than width"
		return
	end

	colors = ['X', 'O', 'A', 'Z', 'W', 'S', 'H'].sample(nr_of_colors)
	knots = colors

	until knots.length == width
		knots << colors.sample
	end

	length.times do |i| # 1 sequence
		width.times do |w|
			knots.unshift(knots.pop)
			puts knots.join(',')
		end
	end
end

simple_bracelet(3, 5, 2)
{'fraction_non_alphanumeric': 0.14719045251118845, 'fraction_numerical': 0.0104425658876181, 'mean_word_length': 3.7904761904761903, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3335898', 'n_tokens_mistral': 874, 'n_tokens_neox': 799, 'n_words': 276}