Skip to content

Commit

Permalink
Defined hussy run for fffizbuzz.
Browse files Browse the repository at this point in the history
  • Loading branch information
tacosontitan committed Apr 15, 2024
1 parent 7510050 commit 525e5b9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
28 changes: 28 additions & 0 deletions samples/Hussy.Net.Playground/Golfing/C272452/HussyDryRun.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Hussy.Net.Playground.Golfing;

public sealed partial class C272452
{
/// <summary>
/// The hussy run simply compresses the golfed dry run.
/// </summary>
/// <param name="t">The stopping value for the test.</param>
/// <returns>
/// A collection of strings representing the output for the specified <paramref name="target"/>.
/// </returns>
/// <remarks>
/// Fully condensed, this method body becomes <c>156</c> bytes.
/// </remarks>
private static IEnumerable<string> HussyDryRun(int t)
{
var results = new List<string>(capacity: t);
Gr(t).E(i =>
{
string e = null;
F(i, Md3, Dv3, _ => e += "Fizz");
F(i, Md5, Dv5, _ => e += "Buzz");
results.Add(e ?? i.Ts());
});

return results;
}
}
3 changes: 2 additions & 1 deletion samples/Hussy.Net.Playground/Golfing/C272452/Tests/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ public sealed partial class C272452
private static TestFunction[] TestFunctions =>
[
DryRun,
GolfedDryRun
GolfedDryRun,
HussyDryRun
];

private static void RunTests(
Expand Down
4 changes: 4 additions & 0 deletions src/Hussy.Net/Hussy.Net.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=allocation/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=allocation_005Ccollections/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=arithmetic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=arithmetic_005Cdivision/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=collections/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=display/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generators/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=input/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iterators/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iterators_005Cfor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iterators_005Cforeach/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iterators_005Cforeach_005Ccartesian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=linq/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -18,6 +21,7 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=linq_005Cmap_005Cindexed/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=linq_005Cstart/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=logic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=logic_005Ccount/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=output/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=primitives/@EntryIndexedValue">True</s:Boolean>
Expand Down

0 comments on commit 525e5b9

Please sign in to comment.