[ create a new paste ] login | about

fulano

Name:
Email:
Site/Blog:
Location: Rexburg. ID
Default language:
Favorite languages: C/C++, Python, Perl
About:

Saved pastes by fulano:

Perl, pasted on Feb 11:
1
2
3
4
5
# A Perl Fizzbuzz implementation that is entirely more complicated than necessary
# the Fizzbuzz is calculated based on a cyclic repetition that I noticed.
$count = 1;
for (1..100)
{
...
view (19 lines, 100 lines of output)
Python, pasted on Apr 4:
1
2
3
4
5
#Generating the Fibonacci sequence with only a list comprehension
for index,number in enumerate (
        [(x < 2 and [[0, 1][x]] #This 'seeds' the first 2 numbers with 0, 1 
            or [locals()['_[1]'][-2] + locals()['_[1]'][-1]] #Undocumented method of gaining access to the list that is currently being built
        )[0]
...
view (8 lines, 20 lines of output, 1 comment)
C++, pasted on Mar 15:
1
2
3
4
5
// FizzBuzz - showing off
#include <string.h>
#include <iostream.h>

string c (int n)
...
view (18 lines, 100 lines of output)
C, pasted on Mar 15:
1
2
3
4
5
//FizzBuzz - Showing off
#include <stdio.h>

int main ()
{
...
view (15 lines, 100 lines of output)
PHP, pasted on Mar 3:
1
2
<?//FizzBuzz - Showing off
for ($i = 1; $i < 101; ++$i) { print ($i%3 && $i%5 ? $i : (!($i%3) ? "Fizz" : "") . (!($i%5) ? "Buzz" : "")) . "\n";}?>
view (2 lines, 100 lines of output)
C++, pasted on Mar 3:
1
2
3
4
5
// FizzBuzz
#include <string.h>
#include <iostream.h>

string fizzBuzz (int num)
...
view (27 lines, 100 lines of output)
C, pasted on Mar 3:
1
2
3
4
5
//FizzBuzz
#include <stdio.h>

char * fizzBuzz (int num, char stringBuff[])
{
...
view (28 lines, 100 lines of output)
PHP, pasted on Mar 3:
1
2
3
4
5
<? //FizzBuzz
for ($i = 1; $i < 101; ++$i)
{
if ($i%3 && $i%5)
{ 
...
view (18 lines, 100 lines of output)
Python, pasted on Mar 3:
1
2
#FizzBuzz - Showing Off
for a in range (1, 101): print [a, ''.join ([["Fizz", ""][bool(a % 3)],["Buzz", ""][bool(a % 5)]])][not a % 3 or not a % 5]
view (2 lines, 100 lines of output)
Python, pasted on Mar 3:
1
2
3
4
5
#FizzBuzz
for a in range (1, 101):
    if a%3 and a%5:
        print a
    else:
...
view (6 lines, 100 lines of output)
Perl, pasted on Mar 3:
1
2
3
4
5
#FizzBuzz
for (1 .. 100)
{
  if ($_ % 3 && $_ % 5)
  {
...
view (12 lines, 100 lines of output)
Perl, pasted on Mar 3:
1
2
#FizzBuzz - Showing Off
print +("Fizz")[$_ % 3] . ("Buzz")[$_ % 5] || $_, $/ for (1 .. 100);
view (2 lines, 100 lines of output)
Perl, pasted on Feb 17:
1
2
3
4
#Sierpinski triangle created from Pascal's Triangle (Centered)

$maxRows = 128;
@row = ();
...
view (19 lines, 128 lines of output)
Perl, pasted on Feb 11:
1
2
3
4
#fgpkerw4kcmnq2mns1ax7ilnd
open (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/)
{$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; 
print $l;}}close (Q);
view (4 lines, 1 line of output)