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/*.*
NadekoBot/bin/debug/data/permissions NadekoBot/bin/debug/data/permissions
NadekoBot/bin/debug/data/incidents NadekoBot/bin/debug/data/incidents
NadekoBot/bin/NadekoRelease/*.*
!NadekoBot/bin/Debug/data/currency_images/* !NadekoBot/bin/Debug/data/currency_images/*
Tests/bin Tests/bin

View File

@ -1,15 +1,15 @@
using NadekoBot.Classes; using Discord.Commands;
using System;
using Mathos.Parser; using Mathos.Parser;
using System.Threading.Tasks; using NadekoBot.Classes;
using Discord.Commands; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace NadekoBot.Modules.Searches.Commands 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"); await e.Channel.SendMessage($"Expression {expression} failed to evaluate");
return; return;
} }
await e.Channel.SendMessage($"`result: {answer}`"); await e.Channel.SendMessage($"⚙ `{answer}`");
}; };
private string Evaluate(string expression) private string Evaluate(string expression)
@ -71,8 +71,8 @@ namespace NadekoBot.Modules.Searches.Commands
static decimal Factorial(decimal x) static decimal Factorial(decimal x)
{ {
decimal y = x-1; decimal y = x - 1;
while (y >0) while (y > 0)
{ {
x = x * y--; x = x * y--;
} }

View File

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

View File

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