Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
| .global _main | |
| .extern _putchar | |
| .align 4 | |
| _main: | |
| ; prolog; save fp,lr,x19 | |
| stp x29, x30, [sp, #-0x20]! | |
| str x19, [sp, #0x10] |
Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.
To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:
\u001b[{format};{color}m
| // The SwiftUI Lab | |
| // Website: https://swiftui-lab.com | |
| // Article: https://swiftui-lab.com/alignment-guides | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var position: Int = 0 | |
| var body: some View { |
| // First, install InjectionIII.app from the Mac AppStore | |
| // https://apps.apple.com/us/app/injectioniii/id1380446739?mt=12 | |
| // Make these changes to your code: | |
| // add the following to application(didFinishLaunchingWithOptions:) | |
| #if DEBUG | |
| Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load() | |
| #endif |
| #include <time.h> // Robert Nystrom | |
| #include <stdio.h> // @munificentbob | |
| #include <stdlib.h> // for Ginny | |
| #define r return // 2008-2019 | |
| #define l(a, b, c, d) for (i y=a;y\ | |
| <b; y++) for (int x = c; x < d; x++) | |
| typedef int i;const i H=40;const i W | |
| =80;i m[40][80];i g(i x){r rand()%x; | |
| }void cave(i s){i w=g(10)+5;i h=g(6) | |
| +3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| let window = UIWindow(frame: UIScreen.main.bounds) |
| import Foundation | |
| struct EquatableValueSequence<T: Equatable> { | |
| static func ==(lhs: EquatableValueSequence<T>, rhs: T) -> Bool { | |
| return lhs.values.contains(rhs) | |
| } | |
| static func ==(lhs: T, rhs: EquatableValueSequence<T>) -> Bool { | |
| return rhs == lhs | |
| } |