Skip to content

Commit 293aae1

Browse files
use correct fizzbuzz
1 parent 1b00ca0 commit 293aae1

File tree

8 files changed

+25
-21
lines changed

8 files changed

+25
-21
lines changed

content/_index.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ title = 'About'
1010
```cognate
1111
~~ Fizzbuzz in Cognate
1212
13-
Def Multiple as (Zero? Modulo);
14-
15-
Def Fizzbuzz
16-
Case (Multiple of 15) is "fizzbuzz"
17-
Case (Multiple of 3) is "fizz"
18-
Case (Multiple of 5) is "buzz"
19-
otherwise ();
13+
Def Fizzbuzz (
14+
Let N be Of (Integer?);
15+
Def Multiple as (Zero? Modulo Swap N);
16+
Print
17+
If Multiple of 15 then "fizzbuzz"
18+
If Multiple of 3 then "fizz"
19+
If Multiple of 5 then "buzz"
20+
else N
21+
);
2022
2123
For each in Range 1 to 100 (Print Fizzbuzz)
2224
```

public/categories/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Categories</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com">
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
11+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1212
</head>
1313
<body>
1414

public/index.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title>Cognate: Readable and concise concatenative programming</title>
1010
<link rel="preconnect" href="https://fonts.googleapis.com">
1111
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
12+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1313
</head>
1414
<body>
1515

@@ -19,13 +19,15 @@ <h1 id="cognate">Cognate</h1>
1919
<h2 id="readable-and-concise-concatenative-programming">Readable and concise concatenative programming</h2>
2020
<div class="code"><pre><code><span style='font-style: italic;color: #969896'>~~ Fizzbuzz in Cognate</span>
2121

22-
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>as</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Zero?</span> <span style='color: #183691'>Modulo</span><span style='color: #4e4e4e'>)</span>;
23-
24-
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Fizzbuzz</span>
25-
<span style='color: #a71d5d'>Case</span> <span style='color: #4e4e4e'>(</span><span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>15</span><span style='color: #4e4e4e'>)</span> <span style='color: #333333'>is</span> <span style='color: #183691'>&quot;fizzbuzz&quot;</span>
26-
<span style='color: #a71d5d'>Case</span> <span style='color: #4e4e4e'>(</span><span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>3</span><span style='color: #4e4e4e'>)</span> <span style='color: #333333'>is</span> <span style='color: #183691'>&quot;fizz&quot;</span>
27-
<span style='color: #a71d5d'>Case</span> <span style='color: #4e4e4e'>(</span><span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>5</span><span style='color: #4e4e4e'>)</span> <span style='color: #333333'>is</span> <span style='color: #183691'>&quot;buzz&quot;</span>
28-
<span style='color: #333333'>otherwise</span> <span style='color: #4e4e4e'>(</span><span style='color: #4e4e4e'>)</span>;
22+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Fizzbuzz</span> <span style='color: #4e4e4e'>(</span>
23+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>N</span> <span style='color: #333333'>be</span> <span style='color: #183691'>Of</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Integer?</span><span style='color: #4e4e4e'>)</span>;
24+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>as</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Zero?</span> <span style='color: #183691'>Modulo</span> <span style='color: #183691'>Swap</span> <span style='color: #795da3'>N</span><span style='color: #4e4e4e'>)</span>;
25+
<span style='color: #183691'>Print</span>
26+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>15</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;fizzbuzz&quot;</span>
27+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>3</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;fizz&quot;</span>
28+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>5</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;buzz&quot;</span>
29+
<span style='color: #333333'>else</span> <span style='color: #795da3'>N</span>
30+
<span style='color: #4e4e4e'>)</span>;
2931

3032
<span style='color: #a71d5d'>For</span> <span style='color: #333333'>each</span> <span style='color: #333333'>in</span> <span style='color: #183691'>Range</span> <span style='color: #0086b3'>1</span> <span style='color: #333333'>to</span> <span style='color: #0086b3'>100</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Print</span> <span style='color: #795da3'>Fizzbuzz</span><span style='color: #4e4e4e'>)</span>
3133
</code></pre></div><p>Cognate is a project aiming to create a human readable programming language with as little syntax as possible. Where natural language programming usually uses many complex syntax rules, instead Cognate takes them away. What it adds is simple, a way to embed comments into statements.</p>

public/learn/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Learn Cognate</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com">
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
11+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1212
</head>
1313
<body>
1414

public/main.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/reference/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Reference</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com">
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
11+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1212
</head>
1313
<body>
1414

public/reference/prelude/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Prelude</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com">
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
11+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1212
</head>
1313
<body>
1414

public/tags/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Tags</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com">
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
11+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
1212
</head>
1313
<body>
1414

0 commit comments

Comments
 (0)