Now my problems are no more definitely, also better calc format

This commit is contained in:
Master Kwoth 2016-05-30 21:59:55 +02:00
parent 542b2948d1
commit a10b5d7786
4 changed files with 13 additions and 12 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ obj/
NadekoBot/bin/debug/*.*
NadekoBot/bin/debug/data/permissions
NadekoBot/bin/debug/data/incidents
NadekoBot/bin/NadekoRelease/*.*
!NadekoBot/bin/Debug/data/currency_images/*
Tests/bin

View File

@ -1,15 +1,15 @@
using NadekoBot.Classes;
using System;
using Discord.Commands;
using Mathos.Parser;
using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Classes;
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace NadekoBot.Modules.Searches.Commands
{
class EvalCommand : DiscordCommand
class CalcCommand : DiscordCommand
{
public EvalCommand(DiscordModule module) : base(module)
public CalcCommand(DiscordModule module) : base(module)
{
}
@ -37,7 +37,7 @@ namespace NadekoBot.Modules.Searches.Commands
await e.Channel.SendMessage($"Expression {expression} failed to evaluate");
return;
}
await e.Channel.SendMessage($"`result: {answer}`");
await e.Channel.SendMessage($"⚙ `{answer}`");
};
private string Evaluate(string expression)
@ -59,7 +59,7 @@ namespace NadekoBot.Modules.Searches.Commands
}
}
class CustomParser : MathParser
{
@ -71,8 +71,8 @@ namespace NadekoBot.Modules.Searches.Commands
static decimal Factorial(decimal x)
{
decimal y = x-1;
while (y >0)
decimal y = x - 1;
while (y > 0)
{
x = x * y--;
}

View File

@ -28,7 +28,7 @@ namespace NadekoBot.Modules.Searches
commands.Add(new ConverterCommand(this));
commands.Add(new RedditCommand(this));
commands.Add(new WowJokeCommand(this));
commands.Add(new EvalCommand(this));
commands.Add(new CalcCommand(this));
commands.Add(new WowJokeCommand(this));
rng = new Random();
}

View File

@ -65,7 +65,7 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NadekoRelease|AnyCPU'">
<OutputPath>bin\NadekoRelease\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NADEKO_RELEASE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>