News:

The moderation team is holding a poll on the topic of the site's connection to Scratch. More details can be found here. Your feedback is appreciated.

Main Menu

Infinite Clipboard

Started by 360-International, Dec 26, 2012, 04:05:00 AM

Previous topic - Next topic

gilbert_given_TBG

oh/10

Note that proper Jumble code has no space nor symbols and numbers; it's a letter-only esolang. For example purposes, I've put such thing so that the code becomes somewhat understandable, but note that that program will fail to run.

(Grammarly suggests the double "that")

PkmnQ

Jumble/10

       _-_
    /~~   ~~\
 /~~         ~~\
{               }
 \  _-     -_  /
   ~  \\ //  ~
_- -   | | _- _
  _ -  | |   -_
      // \\
This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

Byron_Inc_TBG

eh

gilbert_given_TBG

gem/10

import graphics;
main {
  // This demo is a fun little test of the utility of the CRIS language.
  // It is a simple 3D renderer which allows an object to be viewed from different angles.
  // It works by sorting the triangles of the image by a measure of depth and then rendering them from back to front.
 
  // This approach is fast and works most of the time.
  // (For example
 
  // To change between the octahedron and the cube change the line 'auto file = xxx;' so that xxx is either cubefile or octfile.
  // Then recompile the code (by holding the '[' and ']' keys and pressing C) and run again.
 
  auto basevertices;
  auto triangles;
  auto vertices;
 
  // File format for objects
  // # of vertices
  // x y and z coordinates of each vertex
  // # of triangles
  // Color of each triangle and indexes of vertices which it uses
 
  //CUBE
  //   0   1
  // 2   3
  //   4   5
  // 6   7
 
  auto cubefile = {
  8. //points
  -1. 1.  1. // left
  1.  1.  1.
  -1. 1.  -1.
  1.  1.  -1.
  -1. -1. 1. // right
  1.  -1. 1.
  -1. -1. -1.
  1.  -1. -1.
  12. //triangles
  0xff0000. 0.  1.  2.
  0x00ffff. 3.  1.  2.
  0x00ff00. 0.  2.  4.
  0xff00ff. 6.  2.  4.
  0x0000ff. 0.  1.  4.
  0xffff00. 5.  1.  4.
 
  0xff0000. 4.  5.  6.
  0x00ffff. 7.  5.  6.
  0x00ff00. 1.  3.  5.
  0xff00ff. 7.  3.  5.
  0x0000ff. 2.  3.  6.
  0xffff00. 7.  3.  6
  };
 
  auto octfile = {
    6.
    1.  0.  0.
    -1. 0.  0.
    0.  1.  0.
    0.  -1. 0.
    0.  0.  1.
    0.  0.  -1.
    8.
    0xdddddd. 0.  2.  4.
    0x3333dd. 0.  2.  5.
    0x33dd33. 0.  3.  4.
    0x33dddd. 0.  3.  5.
    0xdd3333. 1.  2.  4.
    0xdd33dd. 1.  2.  5.
    0xdddd33. 1.  3.  4.
    0x333333. 1.  3.  5
  };
 
  auto file = octfile;
 
  auto fileindex = 0;
  auto numvertices = file[fileindex];
  basevertices = std.malloc(numvertices);
  vertices = std.malloc(numvertices);
 
  ++fileindex;
  {
    auto i = -1;
    while( ++i < numvertices ){
      basevertices[i] = point3.new(file[fileindex]. file[fileindex + 1]. file[fileindex + 2]);
      vertices[i] = point3.empty();
      fileindex += 3;
    }
  }
 
  auto numtriangles = file[fileindex];
  triangles = std.malloc(numtriangles);
  ++fileindex;
 
  {
    auto i = -1;
    while( ++i < numtriangles ){
      triangles[i] = triangle3.new(file[fileindex]. vertices[file[fileindex + 1]]. vertices[file[fileindex + 2]]. vertices[file[fileindex + 3]]);
      fileindex += 4;
    }
  }

  auto time = in.time;
  auto frames = 0;
 
  while (){
   
    // Copy base vertices
    {
      auto i1 = vertices - 1.
      i2 = basevertices - 1;
      auto max = i1 + numvertices;
      while( i1 < max ){
        auto v1 = *++i1;
        auto v2 = *++i2;
        v1[point3.x] = v2[point3.x];
        v1[point3.y] = v2[point3.y];
        v1[point3.z] = v2[point3.z];
      }
    }
   
    // Rotate each vertex about the origin
    {
      auto xrot = in.time * 11.31;
      auto yrot = in.time * 13.48;
      auto zrot = in.time * 17.76;
     
      auto i = vertices - 1;
      auto max = i + numvertices;
      while( i < max ){
        auto v = *++i;
        write2(
          &v[point3.x].
          v[point3.x] * op.cos(zrot) - v[point3.y] * op.sin(zrot).
          &v[point3.y].
          v[point3.y] * op.cos(zrot) + v[point3.x] * op.sin(zrot)
        ); // Z axis rotation
        write2(
          &v[point3.y].
          v[point3.y] * op.cos(xrot) + v[point3.z] * op.sin(xrot).
          &v[point3.z].
          v[point3.z] * op.cos(xrot) - v[point3.y] * op.sin(xrot)
        ); // X axis rotation
        write2(
          &v[point3.x].
          v[point3.x] * op.cos(yrot) + v[point3.z] * op.sin(yrot).
          &v[point3.z].
          v[point3.z] * op.cos(yrot) - v[point3.x] * op.sin(yrot)
        ); // Y axis rotation
       
        // Compute and save 2D projection
        v[point3.x2] = v[point3.x] * 100;
       v[point3.y2] = v[point3.y] * 100;
// uncomment next two lines to use perspective projection
// Change them to change camera 'position' and FOV
       // v[point3.x2] = v[point3.x] * 300 / (v[point3.z] + 3);
        // v[point3.y2] = v[point3.y] * 300 / (v[point3.z] + 3);
      }
    }
   
    // Sort triangles
   
    sorttris(triangles. numtriangles);
   
   
    // Draw triangles
    {
      auto i = triangles - 1;
      auto max = i + numtriangles;
      while( i < max ){
        auto tri = *++i;
        triangle3.draw(tri);
      }
    }
   
    // Count average FPS
    ++frames;
    auto fps = op.floor((100 * frames)/(in.time - time))/100;
    graphics.text(('Average FPS: ' ++ fps). -236. 176);
    graphics.refresh();
    graphics.clear();
  }
}

// A simple insertion sort
// It's not efficient for large numbers of objects but for small amounts its not too bad

sorttris {
  input tris. numtriangles;
  auto i1 = 0;
  auto max = numtriangles - 1;
 
  while( i1 < max ){ // i1 from 1 to len-1
    ++i1;
    auto i2 = i1;
    auto tri1 = tris[i2];
    auto tri2 = tris[i2-1];
   
    while ( i2 > 0  && triangle3.comparator(tri1. tri2) > 0)
    {
      tris[i2] = tri2;
      --i2;
      tri2 = tris[i2 - 1];
    }
    tris[i2] = tri1;
  }
}

// Inputs: reference 1. value 1. reference 2. value 2
// Writes value 1 into reference 1 and value 2 into reference 2
// In this program this procedure is used to rotate points about one of the three world axes
write2 {
  *() = ();
  *() = ();
}

// Data and methods for a point in 3d space
namespace point3:

  // Layout

  // Location in 3d space
  define x 0
  define y 1
  define z 2

  // Projection onto 2d space; stored so that it only needs to be calcualted once
  define x2 3
  define y2 4

  define msize 5

  empty {
    auto obj = std.malloc(msize);
    return obj;
  }

  new {
    auto obj = std.malloc(msize);
    obj[x] = ();
    obj[y] = ();
    obj[z] = ();
    return obj;
  }

  set {
    auto obj = ();
    obj[x] = ();
    obj[y] = ();
    obj[z] = ();
  }

  copy{
    input src;
    auto new = std.malloc(msize);
    new[x] = src[x];
    new[y] = src[y];
    new[z] = src[z];
  }
endnamespace;

// Data and methods for a trianglular face in 3d space
namespace triangle3:
  define color 0 // Color (hex value)
 

  // Vertices are pointers to point3's
  // Because it is likely that several faces will share vertices
  // This way the transformation only needs to be computed once per point instead of possibly several times
 
  define v1 1
  define v2 2
  define v3 3

  define msize 4

  empty {
    auto obj = std.malloc(msize);
    return obj;
  }

  new {
    auto obj = std.malloc(msize);
    obj[color] = ();
    obj[v1] = ();
    obj[v2] = ();
    obj[v3] = ();
    return obj;
  }

  set {
    auto obj = ();
    obj[color] = ();
    obj[v1] = ();
    obj[v2] = ();
    obj[v3] = ();
  }
 
  comparator {
    auto t1 = ();
    auto t2 = ();
    return
      ( t1[v1][point3.z]
      + t1[v2][point3.z]
      + t1[v3][point3.z]
      - t2[v1][point3.z]
      - t2[v2][point3.z]
      - t2[v3][point3.z]);
  }
 
  draw {
    auto tri = ();
    graphics.filledtri(
      tri[triangle3.color].
      tri[triangle3.v1][point3.x2].
      tri[triangle3.v1][point3.y2].
      tri[triangle3.v2][point3.x2].
      tri[triangle3.v2][point3.y2].
      tri[triangle3.v3][point3.x2].
      tri[triangle3.v3][point3.y2]
    );
  }
 
endnamespace;

Byron_Inc_TBG

(no it's the discord booster icon)

eh

PkmnQ

what is your teacher's phone number/10

       _-_
    /~~   ~~\
 /~~         ~~\
{               }
 \  _-     -_  /
   ~  \\ //  ~
_- -   | | _- _
  _ -  | |   -_
      // \\
This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

Byron_Inc_TBG

Tree/10

Semua pihak wajar bekerjasama untuk menangani keracunan. Pihak ibu bapa dan pihak sekolah haruslah mendidik generasi muda tentang cara-cara mengatasi keracunan makanan. Pihak sekolah juga perlu memastikan kebersihan kantin sekolah. Pihak media massa  digalakkan untuk mengadakan kempen kesedaran, manakala pihak kerajaan memainkan peranan untuk membatalkan restoran-restoran yang tidak mencapai tahap kebersihan minimum.
eh


PkmnQ

This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

gilbert_given_TBG

#8710
8/10

import re;print("".join(b+(" kmgtpe")[a]for a,b in [[x,y]for x,y in enumerate((lambda a:[re.sub("^0+","",a[::-1][i*3:(i+1)*3][::-1])for i in range((len(a)+2)//3)])(input()))][::-1]))

(highlighted first hint)

PkmnQ

This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

Byron_Inc_TBG

10/10/10/10

Keracunan makanan ialah pengambilan makanan atau minuman yang tercemar. Kita mestilah mengatasi keracunan dengan langkah-langkah dan usaha-usaha yang betul supaya hidup dengan sihat.

Langkah pertama ialah kita mestilah belajar cara-cara mengenal pasti makanan dan minuman yang tercemar. Ibu bapa dan guru-guru bertanggungjawab mengajar generasi muda tentang topik tersebut. Contohnya, makanan yang telah basi tidak boleh dimakan. Kita juga wajar memastikan tarikh luput belum terlampau sebelum menikmati juadah.

Justeru itu, kita juga diminta untuk memastikan makanan dan minuman bersih dan sihat. Kita hendaklah memastikan proses penyediaan makanan adalah bersih, contohnya menggunakan penapis air untuk minum air yang bersih. Daging dan makanan laut yang dimakan mesti dimasak. Sekiranya makan di luar rumah, kita patutlah memilih kedai atau gerai yang bersih.

Di samping itu, kebersihan diri juga perlu diambil berat. Kita haruslah memotong kuku sekali seminggu supaya tidak dijangkiti kuman. Kita juga wajar mencuci tangan sebelum dan selepas makan. Maka, kesihatan dan kebersihan diri terjamin.

Tambahan pula, peniaga-peniaga restoran mesti menjaga kebersihan kedai-kedai atau gerai-gerai makanan mereka. Mereka patut memisahkan makanan mentah daripada makanan yang dimasak kerana makanan mental dijangkiti kuman, manakala makanan yang dimasak telah diproses dan kuman dibunuh. Pihak kerajaan pula memainkan peranan untuk membatalkan permit perniagaan restoran-restoran yang tidak mencapai tahap kebersihan minimum.

Sebagai kesimpulannya, semua pihak wajar bekerjasama untuk menangani keracunan makanan. Langkah-langkah dan usaha-usaha mengatasi keracunan makanan perlu diajar ketika usianya kecil untuk mengelakkan kes keracunan makanan.
eh

PkmnQ

YOU DID NOT EXPLAIN/10

(nothing)
This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

Byron_Inc_TBG

eh

PkmnQ

SQL/error

Os axiomas de Peano
1. 0 é um número natural.
2. Para cada número natural x, x = x.
3. Para todos os números naturais x e y, se x = y, então y = x.
4. Para todos os números naturais x, y, e z, se x = y e y = z, então x = z.
5. Para todos os números x e y, se x é um número natural e x = y, então y é um número natural.
6. Para cada número natural x, S(x) é um número natural.
7. Para todos os números naturais x e y, se S(x) = S(y), então x = y.
8. Para cada número natural x, S(x) != 0.
9. Se K é um conjunto tal que 0 está em K e para cada número natural x, se x está em K, então S(x) está em K, então todos os números naturais está em K.
This was a thing I tried to do, but insert mess of a sentence here. Also, I'm a vowelless neither transparent nor translucent mammal of the genus Neogale, I guess. :/ B)
The future experience must be anticipated beforehand to ensure proper expectations.
Tip: Use c͢ombining cha͊racters, because ye᷂s.
Quine list

Threads that I think should be played more (found in the Infinite Flood): link chain

solitaire







Byron_Inc_TBG

-/10

(Nothing, restarted my phone)
eh


Byron_Inc_TBG

eh

gilbert_given_TBG

not/synched
// C program for array implementation of stack
#include
#include
#include
 
// A structure to represent a stack
struct Stack {
    int top;
    unsigned capacity;
    int* array;
};
 
// function to create a stack of given capacity. It initializes size of
// stack as 0
struct Stack* createStack(unsigned capacity)
{
    struct Stack* stack = (struct Stack*)malloc(sizeof(struct Stack));
    stack->capacity = capacity;
    stack->top = -1;
    stack->array = (int*)malloc(stack->capacity * sizeof(int));
    return stack;
}
 
// Stack is full when top is equal to the last index
int isFull(struct Stack* stack)
{
    return stack->top == stack->capacity - 1;
}
 
// Stack is empty when top is equal to -1
int isEmpty(struct Stack* stack)
{
    return stack->top == -1;
}
 
// Function to add an item to stack.  It increases top by 1
void push(struct Stack* stack, int item)
{
    if (isFull(stack))
        return;
    stack->array[++stack->top] = item;
    printf("%d pushed to stack\n", item);
}
 
// Function to remove an item from stack.  It decreases top by 1
int pop(struct Stack* stack)
{
    if (isEmpty(stack))
        return INT_MIN;
    return stack->array[stack->top--];
}
 
// Function to return the top from stack without removing it
int peek(struct Stack* stack)
{
    if (isEmpty(stack))
        return INT_MIN;
    return stack->array[stack->top];
}
 
// Driver program to test above functions
int main()
{
    struct Stack* stack = createStack(100);
 
    push(stack, 10);
    push(stack, 20);
    push(stack, 30);
 
    printf("%d popped from stack\n", pop(stack));
 
    return 0;
}

redgreenandblue

code/10

Here comes a brand new post. You will never see another post like this one again.

Byron_Inc_TBG

#8722
new/post

(nothing)
eh

CoolTBGGaming

https://ecosia.org Switch to Ecosia to help save the environment while searching the internet!

I don't care if my signature doesn't get cut off on certain styles lol

i hate this account ngl


solitaire