Click here to Skip to main content
15,904,024 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.

 
GeneralWordle 1,058 Pin
Sandeep Mewara11-May-24 17:45
mveSandeep Mewara11-May-24 17:45 
GeneralRe: Wordle 1,058 Pin
OriginalGriff11-May-24 19:53
mveOriginalGriff11-May-24 19:53 
GeneralRe: Wordle 1,058 - 3 4 me Pin
pkfox11-May-24 20:44
professionalpkfox11-May-24 20:44 
GeneralRe: Wordle 1,058 Pin
Cp-Coder11-May-24 22:33
Cp-Coder11-May-24 22:33 
GeneralRe: Wordle 1,058 Pin
Sander Rossel12-May-24 0:32
professionalSander Rossel12-May-24 0:32 
GeneralRe: Wordle 1,058 Pin
Amarnath S12-May-24 2:40
professionalAmarnath S12-May-24 2:40 
GeneralRe: Wordle 1,058 Pin
StarNamer@work12-May-24 13:29
professionalStarNamer@work12-May-24 13:29 
GeneralThere are many gotos, but these ones are mine PinPopular
honey the codewitch11-May-24 15:23
mvahoney the codewitch11-May-24 15:23 
Gotos are frowned on. You should not use gotos. Long live gotos.

Until someone comes up with a better/faster/concise way of expressing the following DFA state machine (presented in part) I will continue to defend the use of gotos, even if their use cases have gotten significantly more narrow as progress has marched on.

When you need them, there is no better tool.

C#
internal sealed partial class JsonStringRunner : FAStringRunner {
        private FAMatch NextMatchImpl(string s) {
            int ch;
            int len;
            int p;
            int l;
            int c;
            ch = -1;
            len = 0;
            if ((this.position == -1)) {
                this.position = 0;
            }
            p = this.position;
            l = this.line;
            c = this.column;
            this.Advance(s, ref ch, ref len, true);
            // q0:
            // [\t-\n\r ]
            if (((((ch >= 9) 
                        && (ch <= 10)) 
                        || (ch == 13)) 
                        || (ch == 32))) {
                this.Advance(s, ref ch, ref len, false);
                goto q1;
            }
            // [\"]
            if ((ch == 34)) {
                this.Advance(s, ref ch, ref len, false);
                goto q2;
            }
            // [,]
            if ((ch == 44)) {
                this.Advance(s, ref ch, ref len, false);
                goto q9;
            }
            // [\-]
            if ((ch == 45)) {
                this.Advance(s, ref ch, ref len, false);
                goto q10;
            }
            // [0]
            if ((ch == 48)) {
                this.Advance(s, ref ch, ref len, false);
                goto q11;
            }
            // [1-9]
            if (((ch >= 49) 
                        && (ch <= 57))) {
                this.Advance(s, ref ch, ref len, false);
                goto q17;
            }
            // [\:]
            if ((ch == 58)) {
                this.Advance(s, ref ch, ref len, false);
                goto q18;
            }
            // [\[]
            if ((ch == 91)) {
                this.Advance(s, ref ch, ref len, false);
                goto q19;
            }
            // [\]]
            if ((ch == 93)) {
                this.Advance(s, ref ch, ref len, false);
                goto q20;
            }
            // [f]
            if ((ch == 102)) {
                this.Advance(s, ref ch, ref len, false);
                goto q21;
            }
            // [n]
            if ((ch == 110)) {
                this.Advance(s, ref ch, ref len, false);
                goto q26;
            }
            // [t]
            if ((ch == 116)) {
                this.Advance(s, ref ch, ref len, false);
                goto q30;
            }
            // [\{]
            if ((ch == 123)) {
                this.Advance(s, ref ch, ref len, false);
                goto q32;
            }
            // [\}]
            if ((ch == 125)) {
                this.Advance(s, ref ch, ref len, false);
                goto q33;
            }
            goto errorout;
        q1:
            // [\t-\n\r ]
            if (((((ch >= 9) 
                        && (ch <= 10)) 
                        || (ch == 13)) 
                        || (ch == 32))) {
                this.Advance(s, ref ch, ref len, false);
                goto q1;
            }
            return FAMatch.Create(10, s.Substring(p, len), p, l, c);
        q2:
            // [\0-\t\v-!#-\[\]-\x10ffff]
            if ((((((ch >= 0) 
                        && (ch <= 9)) 
                        || ((ch >= 11) 
                        && (ch <= 33))) 
                        || ((ch >= 35) 
                        && (ch <= 91))) 
                        || ((ch >= 93) 
                        && (ch <= 1114111)))) {
                this.Advance(s, ref ch, ref len, false);
                goto q2;
            }
            // [\"]
            if ((ch == 34)) {
                this.Advance(s, ref ch, ref len, false);
                goto q3;
            }
            // [\\]
            if ((ch == 92)) {
                this.Advance(s, ref ch, ref len, false);
                goto q4;
            }
            goto errorout;
        q3:
            return FAMatch.Create(9, s.Substring(p, len), p, l, c);
        q4:
            // [\"\/\\bfnrt]
            if (((((((((ch == 34) 
                        || (ch == 47)) 
                        || (ch == 92)) 
                        || (ch == 98)) 
                        || (ch == 102)) 
                        || (ch == 110)) 
                        || (ch == 114)) 
                        || (ch == 116))) {
                this.Advance(s, ref ch, ref len, false);
                goto q2;
            }
            // [u]
            if ((ch == 117)) {
                this.Advance(s, ref ch, ref len, false);
                goto q5;
            }
            goto errorout;
        q5:
            // [0-9A-Fa-f]
            if (((((ch >= 48) 
                        && (ch <= 57)) 
                        || ((ch >= 65) 
                        && (ch <= 70))) 
                        || ((ch >= 97) 
                        && (ch <= 102)))) {
                this.Advance(s, ref ch, ref len, false);
                goto q6;
            }
            goto errorout;
        q6:
            // [0-9A-Fa-f]
            if (((((ch >= 48) 
                        && (ch <= 57)) 
                        || ((ch >= 65) 
                        && (ch <= 70))) 
                        || ((ch >= 97) 
                        && (ch <= 102)))) {
                this.Advance(s, ref ch, ref len, false);
                goto q7;
            }
            goto errorout;

Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: There are many gotos, but these ones are mine PinPopular
Ravi Bhavnani11-May-24 15:56
professionalRavi Bhavnani11-May-24 15:56 
GeneralRe: There are many gotos, but these ones are mine Pin
k505412-May-24 4:00
mvek505412-May-24 4:00 
GeneralRe: There are many gotos, but these ones are mine Pin
Ravi Bhavnani12-May-24 6:05
professionalRavi Bhavnani12-May-24 6:05 
GeneralRe: There are many gotos, but these ones are mine Pin
honey the codewitch12-May-24 8:37
mvahoney the codewitch12-May-24 8:37 
GeneralRe: There are many gotos, but these ones are mine Pin
jmaida12-May-24 14:46
jmaida12-May-24 14:46 
GeneralRe: There are many gotos, but these ones are mine Pin
Daniel Will13-May-24 17:09
Daniel Will13-May-24 17:09 
GeneralRe: There are many gotos, but these ones are mine Pin
Amarnath S11-May-24 17:02
professionalAmarnath S11-May-24 17:02 
GeneralRe: There are many gotos, but these ones are mine Pin
trønderen11-May-24 17:40
trønderen11-May-24 17:40 
GeneralRe: There are many gotos, but these ones are mine Pin
honey the codewitch11-May-24 18:01
mvahoney the codewitch11-May-24 18:01 
GeneralRe: There are many gotos, but these ones are mine Pin
trønderen12-May-24 8:15
trønderen12-May-24 8:15 
GeneralRe: There are many gotos, but these ones are mine Pin
honey the codewitch12-May-24 8:28
mvahoney the codewitch12-May-24 8:28 
GeneralRe: There are many gotos, but these ones are mine Pin
honey the codewitch12-May-24 13:56
mvahoney the codewitch12-May-24 13:56 
GeneralRe: There are many gotos, but these ones are mine Pin
den2k8812-May-24 23:08
professionalden2k8812-May-24 23:08 
GeneralRe: There are many gotos, but these ones are mine Pin
trønderen13-May-24 0:17
trønderen13-May-24 0:17 
GeneralRe: There are many gotos, but these ones are mine Pin
giulicard13-May-24 6:59
giulicard13-May-24 6:59 
GeneralRe: There are many gotos, but these ones are mine Pin
honey the codewitch13-May-24 9:21
mvahoney the codewitch13-May-24 9:21 
GeneralRe: There are many gotos, but these ones are mine Pin
giulicard13-May-24 10:03
giulicard13-May-24 10:03 

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.