Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
2
Task/Copy-a-string/Frink/copy-a-string.frink
Normal file
2
Task/Copy-a-string/Frink/copy-a-string.frink
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
a = "Monkey"
|
||||
b = a
|
||||
22
Task/Copy-a-string/Go/copy-a-string-2.go
Normal file
22
Task/Copy-a-string/Go/copy-a-string-2.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// creature string
|
||||
var creature string = "shark"
|
||||
// point to creature
|
||||
var pointer *string = &creature
|
||||
// creature string
|
||||
fmt.Println("creature =", creature) // creature = shark
|
||||
// creature location in memory
|
||||
fmt.Println("pointer =", pointer) // pointer = 0xc000010210
|
||||
// creature through the pointer
|
||||
fmt.Println("*pointer =", *pointer) // *pointer = shark
|
||||
// set creature through the pointer
|
||||
*pointer = "jellyfish"
|
||||
// creature through the pointer
|
||||
fmt.Println("*pointer =", *pointer) // *pointer = jellyfish
|
||||
// creature string
|
||||
fmt.Println("creature =", creature) // creature = jellyfish
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
"this is a string" dup tempString
|
||||
'this_is_a_string dup s:temp
|
||||
|
|
|
|||
3
Task/Copy-a-string/Robotic/copy-a-string.robotic
Normal file
3
Task/Copy-a-string/Robotic/copy-a-string.robotic
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
set "$string1" to "This is a string"
|
||||
set "$string2" to "$string1"
|
||||
* "&$string2&"
|
||||
20
Task/Copy-a-string/X86-Assembly/copy-a-string-1.x86
Normal file
20
Task/Copy-a-string/X86-Assembly/copy-a-string-1.x86
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
section .data
|
||||
string db "Hello World", 0
|
||||
|
||||
section .bss
|
||||
string2 resb 12
|
||||
|
||||
section .text
|
||||
global _main
|
||||
_main:
|
||||
mov ecx, 0
|
||||
looping:
|
||||
mov al, [string + ecx]
|
||||
mov [string2 + ecx], al
|
||||
inc ecx
|
||||
cmp al, 0 ;copy until we find the terminating 0
|
||||
je end
|
||||
jmp looping
|
||||
end:
|
||||
xor eax, eax
|
||||
ret
|
||||
22
Task/Copy-a-string/X86-Assembly/copy-a-string-2.x86
Normal file
22
Task/Copy-a-string/X86-Assembly/copy-a-string-2.x86
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
section .data
|
||||
string db 11,"Hello World"
|
||||
|
||||
section .bss
|
||||
string2 resb 12
|
||||
|
||||
section .text
|
||||
global _main
|
||||
_main:
|
||||
xor ecx, ecx ;clear ecx
|
||||
mov cl, [string]
|
||||
mov [string2], cl ;copy byte signaling length
|
||||
mov edx, 1
|
||||
looping: ;copy each single byte
|
||||
mov al, [string + edx]
|
||||
mov [string2 + edx], al
|
||||
inc edx
|
||||
dec ecx
|
||||
cmp ecx, 0
|
||||
jg looping
|
||||
xor eax, eax
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue