Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
Ignore parentheses, as well as some RBN characters.
Converts existing "-" to the expected "=".
  • Loading branch information
SuperRiderTH committed May 20, 2018
1 parent 0f26d69 commit bfe1079
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion WeebHyphens/Program.cs
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -29,12 +29,30 @@ static bool IsPunctuation(char pun)
case '\"':
case '!':
case '?':
case '(':
case ')':
return true;
default:
return false;
}
}

static bool IsRBNCharacter(char c)
{
switch (c)
{
case '+':
case '#':
case '^':
case '=':
case '@':
return true;
default:
return false;
}
}


static bool IsDigraph(char c1, char c2)
{

Expand Down Expand Up @@ -129,6 +147,28 @@ static void Main(string[] args)
if ( (i + 1) != tempReadChars.Length )
{

if (tempReadChars[i+1] == '-')
{
i++;
tempWriteString += "= ";
continue;
}

if (IsRBNCharacter(tempReadChars[i + 1]))
{
tempWriteString += tempReadChars[i + 1];
tempWriteString += " ";
i += 2;
continue;
}

if (IsRBNCharacter(tempReadChars[i]))
{
i++;
tempWriteString += tempReadChars[i];
continue;
}

if (IsPunctuation(tempReadChars[i + 1]))
{
i++;
Expand Down

0 comments on commit bfe1079

Please sign in to comment.