michaeldv / ante Goto Github PK
View Code? Open in Web Editor NEWEsoteric programming language where all you've got is a deck of cards
License: Other
Esoteric programming language where all you've got is a deck of cards
License: Other
ANTE Ante is an esoteric programming language where all you've got is a deck of playing cards. FOUR REGISTERS, ZERO INITIALIZED ♦ ♥ ♠ ♣ OPERATORS, SEQUENTIAL PRECEDENCE ♦ # Add ♥ # Multiply ♠ # Subtract ♣ # Divide SYNTAX 2-9[x]... # Assignment; the suit of first card designates # target register A[x] # Current value of register [x] (the Ace aces it) K[x] # Jump to the last Q[x] label if A[x] != 0 (go see the Queen) Q[x] # Label (the Queen is waiting) J[x] # Print A[x] as character (Jack shows the goods) 10[x] # Print A[x] as number Kings and Queens can have twins, triplets, etc. of the same suit. While single K♥ goes to Q♥, K♥K♥ twins will go to Q♥Q♥ and so on. EXAMPLE # 15.times { |i| print i } 3♥ 5♥ # ♥ = 3 * 5 Q♥ # Label 10♦ # Print current value of ♦ A♦ 3♦ 2♠ # ♦ = ♦ + 3 - 2 A♥ 3♠ 2♦ # ♥ = ♥ - 3 + 2 K♥ # Jump to Q♥ if ♥ != 0 For more examples check out samples/*.ante files including Yusuke Endoh's mind-boggling Ante quine (the program that prints itself): https://github.com/michaeldv/ante/blob/master/samples/quine.ante LICENSE Copyright (c) 2013-2014 Michael Dvorkin Ante is freely distributable under the terms of MIT license.
ante.swift:47:10: error: expected identifier in function declaration
func repeat(n: Int) -> String {
^
ante.swift:32:29: error: missing argument label 'arrayLiteral:' in call
return String(Array(self)[i])
^
arrayLiteral:
ante.swift:36:16: error: use of unresolved identifier 'countElements'
return countElements(self)
^
ante.swift:53:21: error: cannot invoke initializer for type 'NSRegularExpression' with an argument list of type '(pattern: String, options: NilLiteralConvertible, error: NilLiteralConvertible)'
let regex = NSRegularExpression(pattern: pattern, options: nil, error: nil)
^
ante.swift:53:21: note: overloads for 'NSRegularExpression' exist with these partially matching parameter lists: (pattern: String, options: NSRegularExpressionOptions), (), (coder: NSCoder)
let regex = NSRegularExpression(pattern: pattern, options: nil, error: nil)
^
ante.swift:204:54: error: expected member name following '.'
let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
^
ante.swift:204:54: error: consecutive statements on a line must be separated by ';'
let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
^
;
ante.swift:204:60: error: expected '{' after 'repeat'
let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
^
<unknown>:0: error: expected 'while' after body of 'repeat' statement
ante.swift:275:5: error: 'println' has been renamed to 'print'
println("usage: ante.swift filename.ante");
^~~~~~~
print
Swift.println:1:33: note: 'println' has been explicitly marked unavailable here
@available(*, unavailable) func println<T>(value: T)
^
ante.swift:105:23: error: cannot invoke initializer for type 'NSString' with an argument list of type '(contentsOfFile: String, encoding: UInt, error: inout NSError?)'
let program = NSString(contentsOfFile: fileName, encoding: NSUTF8StringEncoding, error: &error)
^
ante.swift:105:23: note: overloads for 'NSString' exist with these partially matching parameter lists: (unicodeScalarLiteral: StaticString), (extendedGraphemeClusterLiteral: StaticString), (stringLiteral: StaticString), (string: NSString), (), (coder: NSCoder), (characters: UnsafePointer<unichar>, length: Int), (UTF8String: UnsafePointer<Int8>), (string: String), (format: String, arguments: CVaListPointer), (data: NSData, encoding: UInt), (bytesNoCopy: UnsafeMutablePointer<Void>, length: Int, encoding: UInt, freeWhenDone: Bool), (CString: UnsafePointer<Int8>, encoding: UInt), (contentsOfURL: NSURL, encoding: UInt), (contentsOfFile: String, encoding: UInt), (contentsOfURL: NSURL, usedEncoding: UnsafeMutablePointer<UInt>), (contentsOfFile: String, usedEncoding: UnsafeMutablePointer<UInt>), (contentsOfFile: String), (contentsOfURL: NSURL), (CString: UnsafePointer<Int8>, length: Int), (CString: UnsafePointer<Int8>)
let program = NSString(contentsOfFile: fileName, encoding: NSUTF8StringEncoding, error: &error)
^
ante.swift:137:26: error: 'enumerate' is unavailable: call the 'enumerate()' method on the sequence
for (i, line) in enumerate(lines) {
^~~~~~~~~
Swift.enumerate:1:90: note: 'enumerate' has been explicitly marked unavailable here
@available(*, unavailable, message="call the 'enumerate()' method on the sequence") func enumerate<Seq : SequenceType>(base: Seq) -> EnumerateSequence<Seq>
^
ante.swift:139:52: error: ambiguous use of operator '+'
self.code.append(Card(rank: 0, suit: i + 1))
^
Swift.+:1:26: note: found this candidate
@warn_unused_result func +<T : Strideable>(lhs: T.Stride, rhs: T) -> T
^
Swift.+:1:6: note: found this candidate
func +<T : UnsignedIntegerType>(lhs: T._DisallowMixedSignArithmetic, rhs: T) -> T
^
ante.swift:255:43: error: use of unresolved identifier '&/'
initial = initial &/ rank
^
ante.swift:255:43: error: operator is not a known binary operator
initial = initial &/ rank
^
ante.swift:255:43: error: operator is not a known binary operator
initial = initial &/ rank
^
ante.swift:267:9: error: 'println' has been renamed to 'print'
println("Ante exception: \(message) on line \(self.line) (pc:\(self.pc))")
^~~~~~~
print
Swift.println:1:33: note: 'println' has been explicitly marked unavailable here
@available(*, unavailable) func println<T>(value: T)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.