Click here to Skip to main content
15,879,326 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I have high expectations for all of you... Pin
Maximilien26-Mar-20 4:51
Maximilien26-Mar-20 4:51 
GeneralRe: I have high expectations for all of you... Pin
Johnny J.27-Mar-20 0:43
professionalJohnny J.27-Mar-20 0:43 
Generalin viral times Pin
BillWoodruff25-Mar-20 23:27
professionalBillWoodruff25-Mar-20 23:27 
GeneralRe: in viral times Pin
OriginalGriff25-Mar-20 23:50
mveOriginalGriff25-Mar-20 23:50 
GeneralRe: in viral times Pin
BillWoodruff26-Mar-20 0:37
professionalBillWoodruff26-Mar-20 0:37 
GeneralRe: in viral times Pin
Phil.Benson26-Mar-20 0:06
professionalPhil.Benson26-Mar-20 0:06 
GeneralRe: in viral times Pin
BillWoodruff26-Mar-20 0:27
professionalBillWoodruff26-Mar-20 0:27 
GeneralRe: in viral times Pin
BillWoodruff26-Mar-20 0:18
professionalBillWoodruff26-Mar-20 0:18 
in rsponse to a challenge by a CP friend Smile | :)
using System;
using System.Text;

namespace Musaeum
{
    public enum SonnnetType
    {
        Classic,
        Dantean,
        Michelangeloesque,
        Shakespearean,
        Donne,
        HaikuBased,
        FreeForm
    }

    public static class SonnetMaker
    {

        static StringBuilder sb =  new StringBuilder();

        public static string MakeSonnet(SonnnetType stype)
        {
            sb.Clear();

            switch(stype)
            {
                case SonnnetType.HaikuBased:
                    return makeHaikuForm();

                //case SonnnetType.Classic:
                //    break;
                //case SonnnetType.Dantean:
                //    break;
                //case SonnnetType.Michelangeloesquw:
                //    break;
                //case SonnnetType.Shakespereaan:
                //    break;
                //case SonnnetType.Donne:
                //    break;
                //case SonnnetType.FreeForm:
                //    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(stype), stype, null);
            }
        }

        private static string makeHaikuForm ()
        {
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    sb.AppendLine(j == 0 ? getLine(7) : getLine(5));
                }

                sb.AppendLine();
            }
   
            sb.AppendLine(getLine(7));
            sb.AppendLine(getLine(7));

            return sb.ToString();
        }

        private static string getLine(int n)
        {
            return new String('h', n);
        }
    }
}
usage example:
// required: using Musaeum; 

var haiku = SonnetMaker.MakeSonnet(SonnnetType.HaikuBased);

«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali


modified 26-Mar-20 6:39am.

GeneralSpeaking of boredom... Pin
Kornfeld Eliyahu Peter25-Mar-20 23:25
professionalKornfeld Eliyahu Peter25-Mar-20 23:25 
GeneralRe: Speaking of boredom... Pin
PeejayAdams26-Mar-20 2:27
PeejayAdams26-Mar-20 2:27 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 3:25
dandy7226-Mar-20 3:25 
GeneralRe: Speaking of boredom... Pin
PeejayAdams26-Mar-20 3:40
PeejayAdams26-Mar-20 3:40 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:29
dandy7226-Mar-20 5:29 
GeneralRe: Speaking of boredom... Pin
kalberts26-Mar-20 3:48
kalberts26-Mar-20 3:48 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:37
dandy7226-Mar-20 5:37 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:21
dandy7226-Mar-20 5:21 
JokeThe boredom of self isolation... PinPopular
Mike Hankey25-Mar-20 23:00
mveMike Hankey25-Mar-20 23:00 
GeneralRe: The boredom of self isolation... Pin
Johnny J.25-Mar-20 23:02
professionalJohnny J.25-Mar-20 23:02 
GeneralRe: The boredom of self isolation... Pin
Daniel Pfeffer26-Mar-20 0:11
professionalDaniel Pfeffer26-Mar-20 0:11 
GeneralRe: The boredom of self isolation... Pin
Dan Neely26-Mar-20 2:42
Dan Neely26-Mar-20 2:42 
QuestionRe: The boredom of self isolation... Pin
lopatir26-Mar-20 0:54
lopatir26-Mar-20 0:54 
GeneralRe: The boredom of self isolation... Pin
Greg Utas26-Mar-20 1:08
professionalGreg Utas26-Mar-20 1:08 
GeneralRe: The boredom of self isolation... Pin
Mark_Wallace26-Mar-20 2:44
Mark_Wallace26-Mar-20 2:44 
GeneralCovid-19 modelng with SEIR algorithm (link to JS source code) Pin
BillWoodruff25-Mar-20 22:53
professionalBillWoodruff25-Mar-20 22:53 
GeneralWSO CCC OTD 2020-03-26 Pin
OriginalGriff25-Mar-20 22:51
mveOriginalGriff25-Mar-20 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.