View color_table.scala
def loopSeq = ((0 to 0xff) ++ (0x0 to 0xff).reverse)
val arr = {loopSeq map{x => s"{ $x, 0, 0,}, "}} ++
{loopSeq map{x => s"{ 0, $x, 0,}, "}} ++
{loopSeq map{x => s"{ 0, 0, $x,}, "}} ++
{loopSeq map{x => s"{ $x, $x, 0,}, "}} ++
{loopSeq map{x => s"{ 0, $x, $x,}, "}} ++
{loopSeq map{x => s"{ $x, 0, $x,}, "}} ++
{loopSeq map{x => s"{ $x, $x, $x,}, "}}
View main.c
#include <stdio.h>
typedef unsigned short uint16;
typedef unsigned char uint8;
const char numberTable[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
void itoa(uint16 src, char* buf){
uint8 i;
buf[0] = '0';
buf[1] = 'x';
View main.c
#include <stdio.h>
// 未知数の数/方程式の数
#define N 2
int main(void){
// x + 2y = 5
//2x + 3y = 8
double matrix[N][N + 1] = {
{ 1, 2, 5 },
View ImageData.h
#ifndef IMAGEDATA_H_
#define IMAGEDATA_H_
#include <avr/pgmspace.h>
PROGMEM const uint8_t img_src[240][50] = {
{ 0x7, 0xf8, 0xff, 0xff, 0x3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xfe, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, },
{ 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, },
{ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0xff, 0xff, 0xc7, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
View Program.cs
using Sprache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace lambda_calc
{
abstract class Statement { }
abstract class Expr : Statement
View Program.cs
using OpenTK;
using OpenTK.Audio.OpenAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4 {
class Program {
View Main.scala
object Main {
implicit class Point[T <% Double](val self:(T,T)) {
lazy val abs = math.sqrt(self._1 * self._1 + self._2 * self._2)
def -[U <% Double](p:(U,U)) = (self._1 - p._1, self._2 - p._2)
def cross[U <% Double](p:(U,U)) = self._1 * p._2 - self._2 * p._1
}
def crossProduct[T <% Double](polygon:List[(T,T)],points:List[(T,T)]) : List[List[Double]] =
points.map { p => polygon zip(polygon.tail :+ polygon.head) map{ case(a,b) => (a - p) cross (b - p)} }
def isCrossVector(xs:List[Double]) : Boolean = xs.forall(_ > 0) || xs.forall(_ < 0)
def isCross[T <% Double](poly1:List[(T,T)],poly2:List[(T,T)]) : Boolean =
View Main.scala
import scala.collection.immutable.Stack
object Main {
def binOp(q:Stack[Double])(f:(Double,Double) => Double) : Stack[Double] = {
val (b,q2) = q.pop2
val (a,q3) = q2.pop2
q3.push(f(a,b))
}
def unaryOp(q:Stack[Double])(f:(Double) => Double) : Stack[Double] = {
val (a,q2) = q.pop2
View Haiku.scala
println(((s:String) => s.drop(5 + 7).take(5).zip(s.drop(5).take(7)).zip(s.take(5)).map{case ((a,b),c) => s"$a $b $c"}.++(s.drop(5 + 5).take(2).map{x => s" $x"}).mkString("\r\n"))("なかぬならなかせてみようホトトギス"))
View Haiku.cs
// C# : @kamiya_owl
using System; using System.Linq; class Haiku { static void Main() { var haiku = @"
          み か ふ
          ず わ る
          の ず い
          お と け