Skip to content

Commit

Permalink
Fix incorrect hexa 'a' recognition, update meta
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhadeepJasu committed Apr 9, 2021
1 parent 28ad550 commit a043283
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion data/com.github.subhadeepjasu.pebbles.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
<caption>Statistics Mode</caption>
<image>https://raw.githubusercontent.com/SubhadeepJasu/pebbles/master/screenshots/Screenshot-Statistics.png</image>
</screenshot>
<screenshot>
<caption>Programmer Mode</caption>
<image>https://raw.githubusercontent.com/SubhadeepJasu/pebbles/master/screenshots/Screenshot-Programmer.png</image>
</screenshot>
<screenshot>
<caption>Date Mode</caption>
<image>https://raw.githubusercontent.com/SubhadeepJasu/pebbles/master/screenshots/Screenshot-Date.png</image>
Expand Down Expand Up @@ -89,7 +93,7 @@
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
<releases>
<release date="2021-03-28" version="1.1.0">
<release date="2021-04-09" version="1.1.0">
<description>
<p>New:</p>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ com.github.subhadeepjasu.pebbles (1.1.0) bionic; urgency=medium
* Replace imaginary number with universal parabolic constant
* Fix operator precedance

-- Subhadeep Jasu <[email protected]> Sun, 28 Mar 2021 12:42:25 +0530
-- Subhadeep Jasu <[email protected]> Fri, 9 Apr 2021 11:03:25 +0530

com.github.subhadeepjasu.pebbles (1.0.5) bionic; urgency=low

Expand Down
Binary file added screenshots/Screenshot-Programmer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/Core/ProgrammerCalculator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -528,22 +528,22 @@ namespace Pebbles {
return false;
}
// Following the PEMDAS rule: <http://mathworld.wolfram.com/PEMDAS.html>
if ((op1 == 'u') && (op2 == '|' || op2 == 'o' || op2 == 'a' || op2 == '&' || op2 == '<' || op2 == '>' || op2 == '+' || op2 == '-' || op2 == 'x' || op2 == 'n' || op2 == '/' || op2 == '*' || op2 == '!' || op2 == 'm')) {
if ((op1 == 'u') && (op2 == '|' || op2 == 'o' || op2 == '_' || op2 == '&' || op2 == '<' || op2 == '>' || op2 == '+' || op2 == '-' || op2 == 'x' || op2 == 'n' || op2 == '/' || op2 == '*' || op2 == '!' || op2 == 'm')) {
return false;
}
if ((op1 == '!' || op1 == 'm') && (op2 == '|' || op2 == '&' || op2 == '<' || op2 == '>' || op2 == '+' || op2 == '-' || op2 == 'x' || op2 == 'n' || op2 == '/' || op2 == '*')) {
return false;
}
else if ((op1 == '/' || op1 == '*') && (op2 == '|' || op2 == 'o' || op2 == '&' || op2 == 'a' || op2 == '<' || op2 == '>' || op2 == '+' || op2 == '-' || op2 == 'x' || op2 == 'n')) {
else if ((op1 == '/' || op1 == '*') && (op2 == '|' || op2 == 'o' || op2 == '&' || op2 == '_' || op2 == '<' || op2 == '>' || op2 == '+' || op2 == '-' || op2 == 'x' || op2 == 'n')) {
return false;
}
else if ((op1 == '+' || op1 == '-') && (op2 == '<' || op2 == '>' || op2 == '|' || op2 == 'o' || op2 == '&' || op2 == 'a' || op2 == 'x' || op2 == 'n')) {
else if ((op1 == '+' || op1 == '-') && (op2 == '<' || op2 == '>' || op2 == '|' || op2 == 'o' || op2 == '&' || op2 == '_' || op2 == 'x' || op2 == 'n')) {
return false;
}
else if ((op1 == '<' || op1 == '>') && (op2 == '|' || op2 == 'o' || op2 == '&' || op2 == 'a' || op2 == 'x' || op2 == 'n')) {
else if ((op1 == '<' || op1 == '>') && (op2 == '|' || op2 == 'o' || op2 == '&' || op2 == '_' || op2 == 'x' || op2 == 'n')) {
return false;
}
else if ((op1 == '&' || op1 == 'a') && (op2 == '|' || op2 == 'o' || op2 == 'x' || op2 == 'n')) {
else if ((op1 == '&' || op1 == '_') && (op2 == '|' || op2 == 'o' || op2 == 'x' || op2 == 'n')) {
return false;
}
else if ((op1 == 'x' || op1 == 'o' || op1 == 'n') && (op2 == '|')) {
Expand Down Expand Up @@ -579,7 +579,7 @@ namespace Pebbles {
return prog_calc.or (a, b, word_size);
case '!':
return prog_calc.not (a, word_size);
case 'a':
case '_':
return prog_calc.nand (a, b, word_size);
case 'o':
return prog_calc.nor (a, b, word_size);
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ namespace Pebbles {
exp = exp.replace ("and", " & ");
exp = exp.replace ("or", " | ");
exp = exp.replace ("mod", " m ");
exp = exp.replace ("[5]", " a ");
exp = exp.replace ("[5]", " _ ");
exp = exp.replace ("[6]", " n ");
exp = exp.replace ("[7]", " x ");
exp = exp.replace ("[8]", " o ");
Expand All @@ -276,7 +276,7 @@ namespace Pebbles {
case "lr":
case "rr":
case "!":
case "a":
case "_":
case "n":
case "x":
case "o":
Expand Down Expand Up @@ -312,7 +312,7 @@ namespace Pebbles {
ret_val = ret_val.replace ("&", "[1]");
ret_val = ret_val.replace ("|", "[2]");
ret_val = ret_val.replace ("m", "[3]");
ret_val = ret_val.replace ("a", "[4]");
ret_val = ret_val.replace ("_", "[4]");
ret_val = ret_val.replace ("o", "[5]");
ret_val = ret_val.replace ("x", "[6]");
ret_val = ret_val.replace ("n", "[7]");
Expand Down

0 comments on commit a043283

Please sign in to comment.