Click here to Skip to main content
14,486,801 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
MemberMaximilien26-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
mveBillWoodruff25-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
mveBillWoodruff26-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
mveBillWoodruff26-Mar-20 0:27 
GeneralRe: in viral times Pin
BillWoodruff26-Mar-20 0:18
mveBillWoodruff26-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 4 days ago.

GeneralSpeaking of boredom... Pin
Kornfeld Eliyahu Peter25-Mar-20 23:25
mveKornfeld Eliyahu Peter25-Mar-20 23:25 
GeneralRe: Speaking of boredom... Pin
PeejayAdams26-Mar-20 2:27
MemberPeejayAdams26-Mar-20 2:27 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 3:25
Memberdandy7226-Mar-20 3:25 
GeneralRe: Speaking of boredom... Pin
PeejayAdams26-Mar-20 3:40
MemberPeejayAdams26-Mar-20 3:40 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:29
Memberdandy7226-Mar-20 5:29 
GeneralRe: Speaking of boredom... Pin
Member 798912226-Mar-20 3:48
MemberMember 798912226-Mar-20 3:48 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:37
Memberdandy7226-Mar-20 5:37 
GeneralRe: Speaking of boredom... Pin
dandy7226-Mar-20 5:21
Memberdandy7226-Mar-20 5:21 
JokeThe boredom of self isolation... PinPopular
Mike Hankey25-Mar-20 23:00
professionalMike 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
MemberDan Neely26-Mar-20 2:42 
QuestionRe: The boredom of self isolation... Pin
lopatir26-Mar-20 0:54
Memberlopatir26-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
MemberMark_Wallace26-Mar-20 2:44 
GeneralCovid-19 modelng with SEIR algorithm (link to JS source code) Pin
BillWoodruff25-Mar-20 22:53
mveBillWoodruff25-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.