Skip to content
Permalink
Browse files

QuranCode 6.19.1229

SumOfVerse...
  • Loading branch information...
heliwave committed Jul 9, 2019
1 parent 32e139e commit 5d440dd0edd396d91af8a23e301c41a4908f75c8
BIN +270 Bytes (100%) Common/Languages/Arabic.txt
Binary file not shown.
BIN +194 Bytes (100%) Common/Languages/Chinese.txt
Binary file not shown.
BIN +280 Bytes (100%) Common/Languages/English.txt
Binary file not shown.
BIN +290 Bytes (100%) Common/Languages/Russian.txt
Binary file not shown.
@@ -9,6 +9,8 @@ public enum CalculationMode
SumOfLetterValueDigitalRoots,
SumOfWordValueDigitSums,
SumOfWordValueDigitalRoots,
SumOfVerseValueDigitSums,
SumOfVerseValueDigitalRoots,
SumOfConcatenatedLetterValueDigitSums,
SumOfConcatenatedLetterValueDigitalRoots,
SumOfUniqueLetterValues

Some generated files are not rendered by default. Learn more.

this.CalculationModeLabel.Size = new System.Drawing.Size(7, 22);
this.CalculationModeLabel.TabIndex = 26;
this.CalculationModeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.ToolTip.SetToolTip(this.CalculationModeLabel, "Prime numbers");
this.ToolTip.SetToolTip(this.CalculationModeLabel, "Sum of letter values");
this.CalculationModeLabel.Click += new System.EventHandler(this.CalculationModeLabel_Click);
//
// Nth4nMinus1CompositeNumberLabel
{
try
{
m_calculation_mode = (CalculationMode)Enum.Parse(typeof(CalculationMode), parts[1].Trim());
SetCalculationMode((CalculationMode)Enum.Parse(typeof(CalculationMode), parts[1].Trim()));
}
catch
{
m_calculation_mode = CalculationMode.SumOfLetterValues;
SetCalculationMode(CalculationMode.SumOfLetterValues);
}
SetCalculationMode(m_calculation_mode);
}
break;
case "TotalChapterCounts":
m_show_add_controls = true;
ValueLabel_Click(null, null);

m_calculation_mode = CalculationMode.SumOfLetterValues;
SetCalculationMode(m_calculation_mode);
SetCalculationMode(CalculationMode.SumOfLetterValues);

if (m_client.NumerologySystem != null)
{
writer.WriteLine("[Numbers]");
writer.WriteLine("Radix" + "=" + m_radix);
writer.WriteLine("Divisor" + "=" + m_divisor);
writer.WriteLine("CalculationMode" + "=" + m_calculation_mode);
writer.WriteLine("CalculationMode" + "=" + m_client.CalculationMode);
writer.WriteLine("TotalChapterCounts" + "=" + m_total_chapter_counts);
if (m_client.NumerologySystem != null)
{
DecimalLettersTextBox.Visible = (m_radix != Numbers.DEFAULT_RADIX);
DecimalLettersTextBox.Refresh();

if (m_calculation_mode == CalculationMode.SumOfLetterValues)
if (m_client.CalculationMode == CalculationMode.SumOfLetterValues)
{
long value = 0L;
foreach (Phrase phrase in m_client.FoundPhrases)
TextModeComboBox.DropDownHeight = StatisticsGroupBox.Height - TextModeComboBox.Top - TextModeComboBox.Height - 1;
}

CalculationMode m_calculation_mode = CalculationMode.SumOfLetterValues;
private void CalculationModeLabel_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitSums:
{
SetCalculationMode(CalculationMode.SumOfVerseValueDigitalRoots);
}
break;
case CalculationMode.SumOfVerseValueDigitalRoots:
{
SetCalculationMode(CalculationMode.SumOfVerseValueDigitSums);
}
break;
case CalculationMode.SumOfVerseValueDigitSums:
{
SetCalculationMode(CalculationMode.SumOfWordValueDigitalRoots);
}
break;

case CalculationMode.SumOfWordValueDigitalRoots:
{
SetCalculationMode(CalculationMode.SumOfWordValueDigitSums);
}
break;
case CalculationMode.SumOfWordValueDigitalRoots:
{
SetCalculationMode(CalculationMode.SumOfVerseValueDigitSums);
}
break;
case CalculationMode.SumOfVerseValueDigitSums:
{
SetCalculationMode(CalculationMode.SumOfVerseValueDigitalRoots);
}
break;
case CalculationMode.SumOfVerseValueDigitalRoots:
{
SetCalculationMode(CalculationMode.SumOfConcatenatedLetterValueDigitSums);
}
}
}

// backup first
m_calculation_mode = m_client.CalculationMode;
// then re-calculate value
CalculateCurrentValue();
}
}
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[4];
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitSums:
case CalculationMode.SumOfVerseValueDigitSums:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[5];
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitalRoots:
case CalculationMode.SumOfVerseValueDigitalRoots:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[6];
}
break;
case CalculationMode.SumOfUniqueLetterValues:
case CalculationMode.SumOfConcatenatedLetterValueDigitSums:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[7];
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitalRoots:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[8];
}
break;
case CalculationMode.SumOfUniqueLetterValues:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[9];
}
break;
default:
{
CalculationModeLabel.BackColor = Numbers.CALCULATION_MODE_COLORS[0];
}
else
{
CalculateSelectedTextValue();
CalculateSelectedTextValue(); // take into account all Adjusts
}

if (m_active_textbox.SelectionLength == 0) // cursor inside line
{
if (m_translation_readonly)
if (m_user_text_mode)
{
CalculateValueAndDisplayFactors(m_current_text);
}
else
{
Verse verse = GetCurrentVerse();
if (verse != null)
else
{
CalculateAndDisplayCounts(verse);

if (m_client.CalculationMode == CalculationMode.SumOfLetterValues)
{
CalculateValueAndDisplayFactors(verse);
}
else
{
CalculateValueAndDisplayFactors(m_current_text);
}
}
CalculateValueAndDisplayFactors(verse);
}
}
else // edit mode so user can paste any text they like to calculate its value
{
CalculateValueAndDisplayFactors(m_current_text);
}
}
else // some text is highlighted
{
if (m_calculation_mode == CalculationMode.SumOfLetterValues)
if (m_client.CalculationMode == CalculationMode.SumOfLetterValues)
{
CalculateSelectedTextValue();
CalculateSelectedTextValue(); // take into account all Adjusts
}
else
{
if (m_selection_mode)
{
m_current_text = m_active_textbox.Text;
SetCalculationMode(m_calculation_mode);
}
else
{
{
m_current_text = "";
}
SetCalculationMode(m_calculation_mode);
}
else // get current selected text
{
(m_active_textbox.SelectionLength == m_active_textbox.Text.Length)
)
{
SetCalculationMode(m_calculation_mode);
CalculateValueAndDisplayFactors(verses);
}
else // partial text selection
DecimalValueTextBox.Refresh();

bool show_unused_letters_value =
(m_calculation_mode == CalculationMode.SumOfUniqueLetterValues)
(m_client.CalculationMode == CalculationMode.SumOfUniqueLetterValues)
&&
((ValueLabel.Text.EndsWith(L[l]["Value"])) || (ValueLabel.Text.EndsWith(L[l]["User"])));

BIN +1002 Bytes (100%) QuranCode1433.Source.zip
Binary file not shown.
BIN +803 Bytes (100%) QuranCode1433.zip
Binary file not shown.
@@ -1458,7 +1458,9 @@ public static long CalculateValue(string text)
{
text = text.Replace("\r\n", "\n");
text = text.SimplifyTo(s_numerology_system.TextMode);
string[] verse_texts = text.Split('\n');
string[] word_texts = text.Split();

switch (CalculationMode)
{
case CalculationMode.SumOfLetterValues:
@@ -1520,6 +1522,32 @@ public static long CalculateValue(string text)
}
}
break;
case CalculationMode.SumOfVerseValueDigitSums:
{
foreach (string verse_text in verse_texts)
{
long verse_value = 0L;
foreach (char c in verse_text)
{
verse_value += s_numerology_system.CalculateValue(c);
}
result += Numbers.DigitSum(verse_value);
}
}
break;
case CalculationMode.SumOfVerseValueDigitalRoots:
{
foreach (string verse_text in verse_texts)
{
long verse_value = 0L;
foreach (char c in verse_text)
{
verse_value += s_numerology_system.CalculateValue(c);
}
result += Numbers.DigitalRoot(verse_value);
}
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitSums:
{
foreach (string word_text in word_texts)
@@ -1595,8 +1623,9 @@ public static long CalculateValueWithLogging(string text)
{
text = text.Replace("\r\n", "\n");
text = text.SimplifyTo(s_numerology_system.TextMode);

string[] verse_texts = text.Split('\n');
string[] word_texts = text.Split();

switch (CalculationMode)
{
case CalculationMode.SumOfLetterValues:
@@ -1700,6 +1729,38 @@ public static long CalculateValueWithLogging(string text)
}
}
break;
case CalculationMode.SumOfVerseValueDigitSums:
{
foreach (string verse_text in verse_texts)
{
long verse_value = 0L;
foreach (char c in verse_text)
{
Log.Append(c.ToString());
long value = s_numerology_system.CalculateValue(c);
verse_value += value; ValueSum += value;
Log.AppendLine("\t" + value);
}
result += Numbers.DigitSum(verse_value);
}
}
break;
case CalculationMode.SumOfVerseValueDigitalRoots:
{
foreach (string verse_text in verse_texts)
{
long verse_value = 0L;
foreach (char c in verse_text)
{
Log.Append(c.ToString());
long value = s_numerology_system.CalculateValue(c);
verse_value += value; ValueSum += value;
Log.AppendLine("\t" + value);
}
result += Numbers.DigitalRoot(verse_value);
}
}
break;
case CalculationMode.SumOfConcatenatedLetterValueDigitSums:
{
foreach (string word_text in word_texts)
@@ -2881,6 +2942,16 @@ public static long CalculateValueWithLogging(Verse verse)
text = text.Replace(" ", "");
result += CalculateValueWithLogging(text);
}
else if (CalculationMode == CalculationMode.SumOfVerseValueDigitSums)
{
value = Numbers.DigitSum(s_numerology_system.CalculateValue(verse.Text));
Log.Append("\t" + "\t" + "\t" + value);
}
else if (CalculationMode == CalculationMode.SumOfVerseValueDigitalRoots)
{
value = Numbers.DigitalRoot(s_numerology_system.CalculateValue(verse.Text));
Log.Append("\t" + "\t" + "\t" + value);
}
else
{
foreach (Word word in verse.Words)
BIN +4.5 KB (100%) Solution.vs2013.v12.suo
Binary file not shown.
@@ -205,14 +205,16 @@ public static Color GetNumberTypeColor(string text, int radix)

public static Color[] CALCULATION_MODE_COLORS =
{
/* CalculationMode.SumOfLetterValues */ Color.White,
/* CalculationMode.SumOfLetterValueDigitSums */ Color.Pink,
/* CalculationMode.SumOfLetterValueDigitalRoots */ Color.Red,
/* CalculationMode.SumOfWordValueDigitSums */ Color.Cyan,
/* CalculationMode.SumOfWordValueDigitalRoots */ Color.Blue,
/* CalculationMode.SumOfConcatenatedLetterValueDigitSums */ Color.Lime,
/* CalculationMode.SumOfConcatenatedLetterValueDigitalRoots */ Color.Green,
/* CalculationMode.SumOfUniqueLetterValues */ Color.Yellow
/* CalculationMode.SumOfLetterValues */ Color.FromArgb(255, 255, 255),
/* CalculationMode.SumOfLetterValueDigitSums */ Color.FromArgb(255, 192, 192),
/* CalculationMode.SumOfLetterValueDigitalRoots */ Color.FromArgb(255, 0, 0),
/* CalculationMode.SumOfWordValueDigitSums */ Color.FromArgb(128, 128, 255),
/* CalculationMode.SumOfWordValueDigitalRoots */ Color.FromArgb(0, 0, 255),
/* CalculationMode.SumOfVerseValueDigitSums */ Color.FromArgb(128, 192, 128),
/* CalculationMode.SumOfVerseValueDigitalRoots */ Color.FromArgb(0, 128, 0),
/* CalculationMode.SumOfConcatenatedLetterValueDigitSums */ Color.FromArgb(160, 160, 160),
/* CalculationMode.SumOfConcatenatedLetterValueDigitalRoots */ Color.FromArgb(0, 0, 0),
/* CalculationMode.SumOfUniqueLetterValues */ Color.FromArgb(255, 255, 0)
};

// int.MaxValue = 2^32 - 1 = 2147483647;

0 comments on commit 5d440dd

Please sign in to comment.
You can’t perform that action at this time.