| NOTE: For this to work correctly, you must copy the numbered list from the article into a text file called "bandnames.txt". Also, at the time of this writing, there is no space between "43." and "Wolf". For Wolf to be used in your results, you must add the space in your text file. function bandnames(varargin) %By Timmortal, Feb 2014, http://nyarlathotim.blogspot.com % %Syntax: bandnames generates 1 band name % bandnames(number of band names to generate) % ex. bandnames(20) produces 20 bandnames % %Generates metal band names from the list of "100" most overused metal band %names. (Actually 102.) if length(varargin) > 0 numBandNames = varargin{1}; else numBandNames = 1; end fid = fopen('bandnames.txt'); data = textscan(fid,'%s%s%s%s%s','delimiter',' '); fclose(fid); bandNames = data{2}; for ii = 1:numBandNames wordCount = randi(3,1)+1; wordNum = 0; go = 1; while length(unique(wordNum)) < length(wordNum) || go wordNum = randi([1 length(bandNames)],wordCount,1); go = 0; end outputFormat = '%s'; for jj = 2:wordCount outputFormat = [outputFormat ' %s']; end outputFormat = [outputFormat '\r']; fprintf(outputFormat,bandNames{wordNum}) end end |
Thursday, February 27, 2014
The Metal Band Name Generator
After reading The 100 Most Overused Metal Band Name Words, I decided I must create a band name generator. The MATLAB code is below on the right 100 randomly generated band names are the left.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment